org.apache.directory.server.core
Interface DirectoryService

All Superinterfaces:
ServerEntryFactory
All Known Implementing Classes:
DefaultDirectoryService, MockDirectoryService

public interface DirectoryService
extends ServerEntryFactory

Provides JNDI service to AbstractContextFactory.

Version:
$Rev: 927146 $, $Date: 2010-03-24 19:39:54 +0100 (Wed, 24 Mar 2010) $
Author:
Apache Directory Project

Field Summary
static java.lang.String JNDI_KEY
           
 
Method Summary
 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()
           
 java.lang.String getInstanceId()
           
 Interceptor getInterceptor(java.lang.String interceptorName)
          Get an Interceptor instance from its name
 InterceptorChain getInterceptorChain()
           
 java.util.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.
 PartitionNexus getPartitionNexus()
           
 java.util.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, java.lang.String saslMechanism, java.lang.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.
 Partition getSystemPartition()
           
 java.util.List<org.apache.directory.shared.ldap.ldif.LdifEntry> getTestEntries()
          Returns test directory entries(LdifEntry) to be loaded while bootstrapping.
 java.io.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()
           
 boolean isExitVmOnShutdown()
           
 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(java.lang.String ldif, java.lang.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)
           
 void setEventService(EventService eventService)
           
 void setExitVmOnShutdown(boolean exitVmOnShutdown)
           
 void setInstanceId(java.lang.String instanceId)
           
 void setInterceptors(java.util.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(java.util.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)
          Associates a SchemaManager to the service
 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 setSystemPartition(Partition systemPartition)
           
 void setTestEntries(java.util.List<? extends org.apache.directory.shared.ldap.ldif.LdifEntry> testEntries)
          Sets test directory entries(Attributes) to be loaded while bootstrapping.
 void setWorkingDirectory(java.io.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.
 
Methods inherited from interface org.apache.directory.server.core.entry.ServerEntryFactory
newEntry
 

Field Detail

JNDI_KEY

static final java.lang.String JNDI_KEY
Method Detail

revert

long revert(long revision)
            throws java.lang.Exception
Reverts the server's state to an earlier revision. Note that the revsion number still increases to revert back even though the state reverted to is the same. Note that implementations may lock the server from making changes or searching the directory until this operation has completed.

Parameters:
revision - the revision number to revert to
Returns:
the new revision reached by applying all changes needed to revert to the original state
Throws:
java.lang.Exception - if there are problems reverting back to the earlier state
java.lang.IllegalArgumentException - if the revision provided is greater than the current revision or less than 0
java.lang.UnsupportedOperationException - if this feature is not supported by the change log

revert

long revert()
            throws java.lang.Exception
Reverts the server's state to the latest tagged snapshot if one was taken. If there is no tag a illegal state exception will result. If the latest revision is not earlier than the current revision (both are same), then no changes were made to the directory to be reverted. In this case we return the current revision and do nothiig loggin the fact that we ignored the request to revert.

Returns:
the new revision reached by applying all changes needed to revert to the new state or the same version before this call if no revert actually took place
Throws:
java.lang.Exception - if there are problems reverting back to the earlier state
java.lang.UnsupportedOperationException - if this feature is not supported by the change log

getPartitionNexus

PartitionNexus getPartitionNexus()

getInterceptorChain

InterceptorChain getInterceptorChain()

addPartition

void addPartition(Partition partition)
                  throws java.lang.Exception
Throws:
java.lang.Exception

removePartition

void removePartition(Partition partition)
                     throws java.lang.Exception
Throws:
java.lang.Exception

getSchemaManager

org.apache.directory.shared.ldap.schema.SchemaManager getSchemaManager()
Returns:
The Directory Service SchemaManager

getReferralManager

ReferralManager getReferralManager()
Returns:
The referral manager

setReferralManager

void setReferralManager(ReferralManager referralManager)
Set the referralManager

Parameters:
referralManager - The initialized referralManager
XBean Property
hidden="true"

getSchemaService

SchemaService getSchemaService()

setSchemaService

void setSchemaService(SchemaService schemaService)
XBean Property
hidden="true"

getEventService

EventService getEventService()

setEventService

void setEventService(EventService eventService)
XBean Property
hidden="true"

startup

void startup()
             throws java.lang.Exception
Starts up this service.

Throws:
java.lang.Exception - if failed to start up

shutdown

void shutdown()
              throws java.lang.Exception
Shuts down this service.

Throws:
java.lang.Exception - if failed to shut down

sync

void sync()
          throws java.lang.Exception
Calls Partition.sync() for all registered Partitions.

Throws:
java.lang.Exception - if synchronization failed

isStarted

boolean isStarted()
Returns true if this service is started.

Returns:
true if the service has started, false otherwise

getAdminSession

CoreSession getAdminSession()
                            throws java.lang.Exception
Throws:
java.lang.Exception

getSession

CoreSession getSession()
                       throws java.lang.Exception
Gets a logical session to perform operations on this DirectoryService as the anonymous user. This bypasses authentication without propagating a bind operation into the core.

Returns:
a logical session as the anonymous user
Throws:
java.lang.Exception

getSession

CoreSession getSession(LdapPrincipal principal)
                       throws java.lang.Exception
Gets a logical session to perform operations on this DirectoryService as a specific user. This bypasses authentication without propagating a bind operation into the core.

Returns:
a logical session as a specific user
Throws:
java.lang.Exception

getSession

CoreSession getSession(org.apache.directory.shared.ldap.name.DN principalDn,
                       byte[] credentials)
                       throws java.lang.Exception
Gets a logical session to perform operations on this DirectoryService as a specific user with a separate authorization principal. This bypasses authentication without propagating a bind operation into the core.

Returns:
a logical session as a specific user
Throws:
java.lang.Exception

getSession

CoreSession getSession(org.apache.directory.shared.ldap.name.DN principalDn,
                       byte[] credentials,
                       java.lang.String saslMechanism,
                       java.lang.String saslAuthId)
                       throws java.lang.Exception
Gets a logical session to perform operations on this DirectoryService as a specific user with a separate authorization principal. This bypasses authentication without propagating a bind operation into the core.

Returns:
a logical session as a specific user
Throws:
java.lang.Exception

setInstanceId

void setInstanceId(java.lang.String instanceId)
XBean Property
hidden="true"

getInstanceId

java.lang.String getInstanceId()

getPartitions

java.util.Set<? extends Partition> getPartitions()
Gets the Partitions used by this DirectoryService.

Returns:
the set of partitions used

setPartitions

void setPartitions(java.util.Set<? extends Partition> partitions)
Sets Partitions used by this DirectoryService.

Parameters:
partitions - the partitions to used
XBean Property
nestedType="org.apache.directory.server.core.partition.Partition"

isAccessControlEnabled

boolean isAccessControlEnabled()
Returns true if access control checks are enabled.

Returns:
true if access control checks are enabled, false otherwise

setAccessControlEnabled

void setAccessControlEnabled(boolean accessControlEnabled)
Sets whether to enable basic access control checks or not.

Parameters:
accessControlEnabled - true to enable access control checks, false otherwise

isAllowAnonymousAccess

boolean isAllowAnonymousAccess()
Returns true if anonymous access is allowed on entries besides the RootDSE. If the access control subsystem is enabled then access to some entries may not be allowed even when full anonymous access is enabled.

Returns:
true if anonymous access is allowed on entries besides the RootDSE, false if anonymous access is allowed to all entries.

isPasswordHidden

boolean isPasswordHidden()
Returns true if the service requires the userPassword attribute to be masked. It's an option in the server.xml file.

Returns:
true if the service requires that the userPassword is to be hidden

setAllowAnonymousAccess

void setAllowAnonymousAccess(boolean enableAnonymousAccess)
Sets whether to allow anonymous access to entries other than the RootDSE. If the access control subsystem is enabled then access to some entries may not be allowed even when full anonymous access is enabled.

Parameters:
enableAnonymousAccess - true to enable anonymous access, false to disable it

setPasswordHidden

void setPasswordHidden(boolean passwordHidden)
Sets whether the userPassword attribute is readable, or hidden.

Parameters:
passwordHidden - true to enable hide the userPassword attribute, false otherwise

getInterceptors

java.util.List<Interceptor> getInterceptors()
Returns interceptors in the server.

Returns:
the interceptors in the server.

setInterceptors

void setInterceptors(java.util.List<Interceptor> interceptors)
Sets the interceptors in the server.

Parameters:
interceptors - the interceptors to be used in the server.
XBean Property
nestedType="org.apache.directory.server.core.interceptor.Interceptor"

setJournal

void setJournal(Journal journal)


getTestEntries

java.util.List<org.apache.directory.shared.ldap.ldif.LdifEntry> getTestEntries()
Returns test directory entries(LdifEntry) to be loaded while bootstrapping.

Returns:
test entries to load during bootstrapping

setTestEntries

void setTestEntries(java.util.List<? extends org.apache.directory.shared.ldap.ldif.LdifEntry> testEntries)
Sets test directory entries(Attributes) to be loaded while bootstrapping.

Parameters:
testEntries - the test entries to load while bootstrapping
XBean Property
nestedType="org.apache.directory.shared.ldap.ldif.Entry"

getWorkingDirectory

java.io.File getWorkingDirectory()
Returns working directory (counterpart of var/lib) where partitions are stored by default.

Returns:
the directory where partition's are stored.

setWorkingDirectory

void setWorkingDirectory(java.io.File workingDirectory)
Sets working directory (counterpart of var/lib) where partitions are stored by default.

Parameters:
workingDirectory - the directory where the server's partitions are stored by default.

setShutdownHookEnabled

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. This is enabled by default.

Parameters:
shutdownHookEnabled - true to enable the shutdown hook, false to disable
XBean Property
hidden="true"

isShutdownHookEnabled

boolean isShutdownHookEnabled()
Checks to see if this DirectoryService has registered a JVM shutdown hook to flush caches and synchronize to disk safely. This is enabled by default.

Returns:
true if a shutdown hook is registered, false if it is not

setExitVmOnShutdown

void setExitVmOnShutdown(boolean exitVmOnShutdown)

isExitVmOnShutdown

boolean isExitVmOnShutdown()

setSystemPartition

void setSystemPartition(Partition systemPartition)

getSystemPartition

Partition getSystemPartition()

isDenormalizeOpAttrsEnabled

boolean isDenormalizeOpAttrsEnabled()

setDenormalizeOpAttrsEnabled

void setDenormalizeOpAttrsEnabled(boolean denormalizeOpAttrsEnabled)

getChangeLog

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.

Returns:
the change log service

getJournal

Journal getJournal()
Gets the Journal service for this DirectoryService used for tracking changes to the server.

Returns:
the journal service

setChangeLog

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.

Parameters:
changeLog - the change log service to set

newEntry

org.apache.directory.shared.ldap.entry.ServerEntry newEntry(java.lang.String ldif,
                                                            java.lang.String dn)
Create a new ServerEntry.

Parameters:
ldif - the String representing the attributes, in LDIF format
dn - the DN for this new entry

getOperationManager

OperationManager getOperationManager()
Gets the operation manager.


getMaxPDUSize

int getMaxPDUSize()
Returns:
The maximum allowed size for an incoming PDU

setMaxPDUSize

void setMaxPDUSize(int maxPDUSize)
Set the maximum allowed size for an incoming PDU

Parameters:
maxPDUSize - A positive number of bytes for the PDU. A negative or null value will be transformed to Integer.MAX_VALUE

getInterceptor

Interceptor getInterceptor(java.lang.String interceptorName)
Get an Interceptor instance from its name

Parameters:
interceptorName - The interceptor's name for which we want the instance
Returns:

getCSN

org.apache.directory.shared.ldap.csn.Csn getCSN()
Get a new CSN

Returns:
The CSN generated for this directory service

getReplicaId

int getReplicaId()
Returns:
the replicaId

setReplicaId

void setReplicaId(int replicaId)
Parameters:
replicaId - the replicaId to set

setReplicationConfiguration

void setReplicationConfiguration(ReplicationConfiguration replicationConfig)
Sets the replication configuration in the server.

Parameters:
replicationConfiguration - the replication configuration to be used in the server.

getReplicationConfiguration

ReplicationConfiguration getReplicationConfiguration()
Returns:
the replication configuration for this DirectoryService

setSchemaManager

void setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
Associates a SchemaManager to the service

Parameters:
schemaManager - The SchemaManager to associate


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.