public class DefaultDirectoryService extends Object implements DirectoryService
DirectoryService.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_SIZE_LIMIT_DEFAULT
The default timeLimit : 100 entries
|
static int |
MAX_TIME_LIMIT_DEFAULT
The default timeLimit : 10 seconds
|
JNDI_KEY| Constructor and Description |
|---|
DefaultDirectoryService()
Creates a new instance of the directory service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPartition(Partition partition) |
CoreSession |
getAdminSession() |
ChangeLog |
getChangeLog()
Gets the ChangeLog service for this DirectoryService used for tracking
changes (revisions) to the server and using them to revert the server
to earlier revisions.
|
org.apache.directory.shared.ldap.csn.Csn |
getCSN()
Get a new CSN
|
EventService |
getEventService() |
String |
getInstanceId() |
Interceptor |
getInterceptor(String interceptorName)
Get an Interceptor instance from its name
|
InterceptorChain |
getInterceptorChain() |
List<Interceptor> |
getInterceptors()
Returns interceptors in the server.
|
Journal |
getJournal()
Gets the Journal service for this DirectoryService used for tracking
changes to the server.
|
int |
getMaxPDUSize() |
OperationManager |
getOperationManager()
Gets the operation manager.
|
DefaultPartitionNexus |
getPartitionNexus() |
Set<? extends Partition> |
getPartitions()
Gets the
Partitions used by this DirectoryService. |
ReferralManager |
getReferralManager() |
int |
getReplicaId() |
ReplicationConfiguration |
getReplicationConfiguration() |
org.apache.directory.shared.ldap.schema.SchemaManager |
getSchemaManager() |
SchemaService |
getSchemaService() |
CoreSession |
getSession()
Gets a logical session to perform operations on this DirectoryService
as the anonymous user.
|
CoreSession |
getSession(org.apache.directory.shared.ldap.name.DN principalDn,
byte[] credentials)
Gets a logical session to perform operations on this DirectoryService
as a specific user with a separate authorization principal.
|
CoreSession |
getSession(org.apache.directory.shared.ldap.name.DN principalDn,
byte[] credentials,
String saslMechanism,
String saslAuthId)
Gets a logical session to perform operations on this DirectoryService
as a specific user with a separate authorization principal.
|
CoreSession |
getSession(LdapPrincipal principal)
Gets a logical session to perform operations on this DirectoryService
as a specific user.
|
long |
getSyncPeriodMillis() |
Partition |
getSystemPartition() |
List<org.apache.directory.shared.ldap.ldif.LdifEntry> |
getTestEntries()
Returns test directory entries(
LdifEntry) to be loaded while
bootstrapping. |
File |
getWorkingDirectory()
Returns working directory (counterpart of var/lib) where partitions are
stored by default.
|
boolean |
isAccessControlEnabled()
Returns true if access control checks are enabled.
|
boolean |
isAllowAnonymousAccess()
Returns true if anonymous access is allowed on entries besides the RootDSE.
|
boolean |
isDenormalizeOpAttrsEnabled()
return true if the operational attributes must be normalized when returned
|
boolean |
isExitVmOnShutdown() |
boolean |
isFirstStart() |
boolean |
isPasswordHidden()
Returns true if the service requires the userPassword attribute
to be masked.
|
boolean |
isShutdownHookEnabled()
Checks to see if this DirectoryService has registered a JVM shutdown hook
to flush caches and synchronize to disk safely.
|
boolean |
isStarted()
Returns true if this service is started.
|
org.apache.directory.shared.ldap.entry.ServerEntry |
newEntry(org.apache.directory.shared.ldap.name.DN dn)
Creates a new ServerEntry which has not yet been added to the
directory.
|
org.apache.directory.shared.ldap.entry.ServerEntry |
newEntry(String ldif,
String dn)
Create a new ServerEntry
|
void |
removePartition(Partition partition) |
long |
revert()
Reverts the server's state to the latest tagged snapshot if one was taken.
|
long |
revert(long revision)
Reverts the server's state to an earlier revision.
|
void |
setAccessControlEnabled(boolean accessControlEnabled)
Sets whether to enable basic access control checks or not.
|
void |
setAllowAnonymousAccess(boolean enableAnonymousAccess)
Sets whether to allow anonymous access to entries other than the RootDSE.
|
void |
setChangeLog(ChangeLog changeLog)
Sets the ChangeLog service for this DirectoryService used for tracking
changes (revisions) to the server and using them to revert the server
to earlier revisions.
|
void |
setDenormalizeOpAttrsEnabled(boolean denormalizeOpAttrsEnabled)
Sets whether the operational attributes are denormalized when returned
|
void |
setEventService(EventService eventService) |
void |
setExitVmOnShutdown(boolean exitVmOnShutdown) |
void |
setInstanceId(String instanceId) |
void |
setInterceptors(List<Interceptor> interceptors)
Sets the interceptors in the server.
|
void |
setJournal(Journal journal) |
void |
setMaxPDUSize(int maxPDUSize)
Set the maximum allowed size for an incoming PDU
|
void |
setPartitions(Set<? extends Partition> partitions)
Sets
Partitions used by this DirectoryService. |
void |
setPasswordHidden(boolean passwordHidden)
Sets whether the userPassword attribute is readable, or hidden.
|
void |
setReferralManager(ReferralManager referralManager)
Set the referralManager
|
void |
setReplicaId(int replicaId) |
void |
setReplicationConfiguration(ReplicationConfiguration replicationConfig)
Sets the replication configuration in the server.
|
void |
setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
Set the SchemaManager instance.
|
void |
setSchemaService(SchemaService schemaService) |
void |
setShutdownHookEnabled(boolean shutdownHookEnabled)
Sets the shutdown hook flag which controls whether or not this DirectoryService
registers a JVM shutdown hook to flush caches and synchronize to disk safely.
|
void |
setSyncPeriodMillis(long syncPeriodMillis) |
void |
setSystemPartition(Partition systemPartition) |
void |
setTestEntries(List<? extends org.apache.directory.shared.ldap.ldif.LdifEntry> testEntries)
Sets test directory entries(
Attributes) to be loaded while
bootstrapping. |
void |
setWorkingDirectory(File workingDirectory)
Sets working directory (counterpart of var/lib) where partitions are stored
by default.
|
void |
shutdown()
Shuts down this service.
|
void |
startup()
Starts up this service.
|
void |
sync()
Calls
Partition.sync() for all registered Partitions. |
public static final int MAX_SIZE_LIMIT_DEFAULT
public static final int MAX_TIME_LIMIT_DEFAULT
public void setInstanceId(String instanceId)
setInstanceId in interface DirectoryServicepublic String getInstanceId()
getInstanceId in interface DirectoryServicepublic Set<? extends Partition> getPartitions()
Partitions used by this DirectoryService.getPartitions in interface DirectoryServicepublic void setPartitions(Set<? extends Partition> partitions)
Partitions used by this DirectoryService.setPartitions in interface DirectoryServicepartitions - the partitions to usedpublic boolean isAccessControlEnabled()
isAccessControlEnabled in interface DirectoryServicepublic void setAccessControlEnabled(boolean accessControlEnabled)
setAccessControlEnabled in interface DirectoryServiceaccessControlEnabled - true to enable access control checks, false otherwisepublic boolean isAllowAnonymousAccess()
isAllowAnonymousAccess in interface DirectoryServicepublic void setAllowAnonymousAccess(boolean enableAnonymousAccess)
setAllowAnonymousAccess in interface DirectoryServiceenableAnonymousAccess - true to enable anonymous access, false to disable itpublic List<Interceptor> getInterceptors()
getInterceptors in interface DirectoryServicepublic void setInterceptors(List<Interceptor> interceptors)
setInterceptors in interface DirectoryServiceinterceptors - the interceptors to be used in the server.public List<org.apache.directory.shared.ldap.ldif.LdifEntry> getTestEntries()
LdifEntry) to be loaded while
bootstrapping.getTestEntries in interface DirectoryServicepublic void setTestEntries(List<? extends org.apache.directory.shared.ldap.ldif.LdifEntry> testEntries)
Attributes) to be loaded while
bootstrapping.setTestEntries in interface DirectoryServicetestEntries - the test entries to load while bootstrappingpublic File getWorkingDirectory()
getWorkingDirectory in interface DirectoryServicepublic void setWorkingDirectory(File workingDirectory)
setWorkingDirectory in interface DirectoryServiceworkingDirectory - the directory where the server's partitions are stored by default.public void setShutdownHookEnabled(boolean shutdownHookEnabled)
DirectoryServicesetShutdownHookEnabled in interface DirectoryServiceshutdownHookEnabled - true to enable the shutdown hook, false to disablepublic boolean isShutdownHookEnabled()
DirectoryServiceisShutdownHookEnabled in interface DirectoryServicepublic void setExitVmOnShutdown(boolean exitVmOnShutdown)
setExitVmOnShutdown in interface DirectoryServicepublic boolean isExitVmOnShutdown()
isExitVmOnShutdown in interface DirectoryServicepublic void setSystemPartition(Partition systemPartition)
setSystemPartition in interface DirectoryServicepublic Partition getSystemPartition()
getSystemPartition in interface DirectoryServicepublic boolean isDenormalizeOpAttrsEnabled()
isDenormalizeOpAttrsEnabled in interface DirectoryServicepublic void setDenormalizeOpAttrsEnabled(boolean denormalizeOpAttrsEnabled)
setDenormalizeOpAttrsEnabled in interface DirectoryServicedenormalizeOpAttrsEnabled - The flag valuepublic ChangeLog getChangeLog()
getChangeLog in interface DirectoryServicepublic Journal getJournal()
getJournal in interface DirectoryServicepublic void setChangeLog(ChangeLog changeLog)
setChangeLog in interface DirectoryServicechangeLog - the change log service to setpublic void setJournal(Journal journal)
setJournal in interface DirectoryServicepublic void addPartition(Partition partition) throws Exception
addPartition in interface DirectoryServiceExceptionpublic void removePartition(Partition partition) throws Exception
removePartition in interface DirectoryServiceExceptionpublic CoreSession getAdminSession()
getAdminSession in interface DirectoryServicepublic CoreSession getSession()
DirectoryServicegetSession in interface DirectoryServicepublic CoreSession getSession(LdapPrincipal principal)
DirectoryServicegetSession in interface DirectoryServicepublic CoreSession getSession(org.apache.directory.shared.ldap.name.DN principalDn, byte[] credentials) throws Exception
DirectoryServicegetSession in interface DirectoryServiceExceptionpublic CoreSession getSession(org.apache.directory.shared.ldap.name.DN principalDn, byte[] credentials, String saslMechanism, String saslAuthId) throws Exception
DirectoryServicegetSession in interface DirectoryServiceExceptionpublic long revert()
throws Exception
DirectoryServicerevert in interface DirectoryServiceException - if there are problems reverting back to the earlier stateUnsupportedOperationException - if this feature is not supported by the
change logpublic long revert(long revision)
throws Exception
DirectoryServicerevert in interface DirectoryServicerevision - the revision number to revert toException - if there are problems reverting back to the earlier stateIllegalArgumentException - if the revision provided is greater than the current
revision or less than 0UnsupportedOperationException - if this feature is not supported by the
change logpublic OperationManager getOperationManager()
DirectoryServicegetOperationManager in interface DirectoryServicepublic void startup()
throws Exception
DirectoryServicestartup in interface DirectoryServiceException - if the LDAP server cannot be startedpublic void sync()
throws Exception
DirectoryServicePartition.sync() for all registered Partitions.sync in interface DirectoryServiceException - if synchronization failedpublic void shutdown()
throws Exception
DirectoryServiceshutdown in interface DirectoryServiceException - if failed to shut downpublic ReferralManager getReferralManager()
getReferralManager in interface DirectoryServicepublic void setReferralManager(ReferralManager referralManager)
setReferralManager in interface DirectoryServicereferralManager - The initialized referralManagerpublic org.apache.directory.shared.ldap.schema.SchemaManager getSchemaManager()
getSchemaManager in interface DirectoryServicepublic void setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
setSchemaManager in interface DirectoryServiceschemaManager - The schemaManagerpublic SchemaService getSchemaService()
getSchemaService in interface DirectoryServicepublic void setSchemaService(SchemaService schemaService)
setSchemaService in interface DirectoryServicepublic DefaultPartitionNexus getPartitionNexus()
getPartitionNexus in interface DirectoryServicepublic InterceptorChain getInterceptorChain()
getInterceptorChain in interface DirectoryServicepublic boolean isFirstStart()
public boolean isStarted()
DirectoryServiceisStarted in interface DirectoryServicepublic org.apache.directory.shared.ldap.entry.ServerEntry newEntry(org.apache.directory.shared.ldap.name.DN dn)
ServerEntryFactorynewEntry in interface ServerEntryFactorypublic org.apache.directory.shared.ldap.entry.ServerEntry newEntry(String ldif, String dn)
newEntry in interface DirectoryServiceldif - The String representing the attributes, as a LDIF filedn - The DN for this new entrypublic EventService getEventService()
getEventService in interface DirectoryServicepublic void setEventService(EventService eventService)
setEventService in interface DirectoryServicepublic boolean isPasswordHidden()
isPasswordHidden in interface DirectoryServicepublic void setPasswordHidden(boolean passwordHidden)
setPasswordHidden in interface DirectoryServicepasswordHidden - true to enable hide the userPassword attribute, false otherwisepublic int getMaxPDUSize()
getMaxPDUSize in interface DirectoryServicepublic void setMaxPDUSize(int maxPDUSize)
setMaxPDUSize in interface DirectoryServicemaxPDUSize - A positive number of bytes for the PDU. A negative or
null value will be transformed to Integer.MAX_VALUEpublic Interceptor getInterceptor(String interceptorName)
getInterceptor in interface DirectoryServiceinterceptorName - The interceptor's name for which we want the instancepublic org.apache.directory.shared.ldap.csn.Csn getCSN()
getCSN in interface DirectoryServicepublic int getReplicaId()
getReplicaId in interface DirectoryServicepublic void setReplicaId(int replicaId)
setReplicaId in interface DirectoryServicereplicaId - the replicaId to setpublic void setReplicationConfiguration(ReplicationConfiguration replicationConfig)
DirectoryServicesetReplicationConfiguration in interface DirectoryServicepublic ReplicationConfiguration getReplicationConfiguration()
getReplicationConfiguration in interface DirectoryServicepublic long getSyncPeriodMillis()
public void setSyncPeriodMillis(long syncPeriodMillis)
syncPeriodMillis - the syncPeriodMillis to setCopyright © 2003-2012 Apache Software Foundation. All Rights Reserved.