public class ApacheDS
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static long |
DEFAULT_SYNC_PERIOD_MILLIS
Default delay between two flushes to the backend
|
private DirectoryService |
directoryService
The directory service
|
private LdapServer |
ldapServer
The LDAP server protocol handler
|
private java.io.File |
ldifDirectory
Directory where are stored the LDIF files to be loaded at startup
|
private java.util.List<LdifLoadFilter> |
ldifFilters |
private static org.slf4j.Logger |
LOG |
private long |
synchPeriodMillis
Wainting period between two flushes to the backend
|
| Constructor and Description |
|---|
ApacheDS(LdapServer ldapServer)
Creates a new instance of the ApacheDS server
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addFileEntry(java.io.File ldif) |
private org.apache.directory.api.ldap.model.name.Dn |
buildProtectedFileEntryDn(java.io.File ldif)
Create a string containing a hex dump of the loaded ldif file name.
|
private void |
ensureLdifFileBase()
Check that the entry where are stored the loaded Ldif files is created.
|
private java.lang.String |
getCanonical(java.io.File file) |
DirectoryService |
getDirectoryService() |
LdapServer |
getLdapServer() |
java.io.File |
getLdifDirectory()
Get the directory where the LDIF files are stored
|
long |
getSynchPeriodMillis() |
private void |
initSchema()
initialize the schema partition by loading the schema LDIF files
|
boolean |
isStarted() |
private void |
loadLdif(java.io.File ldifFile)
Load a ldif into the directory.
|
void |
loadLdifs()
Load the existing LDIF files in alphabetic order
|
void |
setLdifDirectory(java.io.File ldifDirectory) |
void |
setSynchPeriodMillis(long synchPeriodMillis) |
void |
shutdown() |
void |
startup()
Start the server :
initialize the DirectoryService
start the LDAP server
start the LDAPS server
|
private static final org.slf4j.Logger LOG
private static final long DEFAULT_SYNC_PERIOD_MILLIS
private long synchPeriodMillis
private java.io.File ldifDirectory
private final java.util.List<LdifLoadFilter> ldifFilters
private final LdapServer ldapServer
private DirectoryService directoryService
public ApacheDS(LdapServer ldapServer) throws java.lang.Exception
ldapServer - The ldap server protocol handlerjava.lang.Exceptionpublic void startup()
throws java.lang.Exception
NamingException - If the server cannot be startedjava.io.IOException - If an IO error occurred while reading some filejava.lang.Exceptionpublic boolean isStarted()
public void shutdown()
throws java.lang.Exception
java.lang.Exceptionpublic LdapServer getLdapServer()
public DirectoryService getDirectoryService()
public long getSynchPeriodMillis()
public void setSynchPeriodMillis(long synchPeriodMillis)
public java.io.File getLdifDirectory()
public void setLdifDirectory(java.io.File ldifDirectory)
private void ensureLdifFileBase()
throws java.lang.Exception
java.lang.Exceptionprivate org.apache.directory.api.ldap.model.name.Dn buildProtectedFileEntryDn(java.io.File ldif)
throws java.lang.Exception
java.lang.Exceptionprivate void addFileEntry(java.io.File ldif)
throws java.lang.Exception
java.lang.Exceptionprivate java.lang.String getCanonical(java.io.File file)
private void loadLdif(java.io.File ldifFile)
throws java.lang.Exception
root - The context in which we will inject the entriesldifFile - The ldif file to readNamingException - If something went wrong while loading the entriesjava.lang.Exceptionpublic void loadLdifs()
throws java.lang.Exception
java.lang.Exceptionprivate void initSchema()
throws java.lang.Exception
java.lang.Exception - in case of any problems while extracting and writing the schema files