org.apache.directory.server.core
Class DirectoryService

java.lang.Object
  extended by org.apache.directory.server.core.DirectoryService

public abstract class DirectoryService
extends java.lang.Object

Provides JNDI service to AbstractContextFactory.

Version:
$Rev: 434579 $, $Date: 2006-08-24 20:19:11 -0400 (Thu, 24 Aug 2006) $
Author:
Apache Directory Project

Constructor Summary
DirectoryService()
           
 
Method Summary
static java.util.Set getAllInstances()
          Returns all instances of instantiated DirectoryService.
abstract  DirectoryServiceConfiguration getConfiguration()
          Returns the configuration of this service.
static DirectoryService getInstance()
          Returns the default instance.
static DirectoryService getInstance(java.lang.String instanceId)
          Returns DirectoryService with the specified instance ID.
abstract  javax.naming.Context getJndiContext(LdapDN principalDn, java.lang.String principal, byte[] credential, java.lang.String authentication, java.lang.String baseName)
          Returns a JNDI Context with the specified authentication information (principal, credential, and authentication) and baseName.
abstract  javax.naming.Context getJndiContext(java.lang.String baseName)
          Returns an anonymous JNDI Context with the specified baseName
abstract  boolean isStarted()
          Returns true if this service is started.
abstract  void shutdown()
          Shuts down this service.
abstract  void startup(DirectoryServiceListener listener, java.util.Hashtable environment)
          Starts up this service.
abstract  void sync()
          Calls Partition.sync() for all registered Partitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryService

public DirectoryService()
Method Detail

getInstance

public static DirectoryService getInstance()
Returns the default instance. This method is identical with calling getInstance( Configuration.DEFAULT_INSTANCE_ID ).


getInstance

public static DirectoryService getInstance(java.lang.String instanceId)
Returns DirectoryService with the specified instance ID.


getAllInstances

public static java.util.Set getAllInstances()
Returns all instances of instantiated DirectoryService.


startup

public abstract void startup(DirectoryServiceListener listener,
                             java.util.Hashtable environment)
                      throws javax.naming.NamingException
Starts up this service.

Parameters:
listener - a listener that listens to the lifecycle of this service
environment - JNDI InitialContext environment
Throws:
javax.naming.NamingException - if failed to start up

shutdown

public abstract void shutdown()
                       throws javax.naming.NamingException
Shuts down this service.

Throws:
javax.naming.NamingException - if failed to shut down

sync

public abstract void sync()
                   throws javax.naming.NamingException
Calls Partition.sync() for all registered Partitions.

Throws:
javax.naming.NamingException - if synchronization failed

isStarted

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


getConfiguration

public abstract DirectoryServiceConfiguration getConfiguration()
Returns the configuration of this service.


getJndiContext

public abstract javax.naming.Context getJndiContext(java.lang.String baseName)
                                             throws javax.naming.NamingException
Returns an anonymous JNDI Context with the specified baseName

Throws:
javax.naming.NamingException - if failed to create a context

getJndiContext

public abstract javax.naming.Context getJndiContext(LdapDN principalDn,
                                                    java.lang.String principal,
                                                    byte[] credential,
                                                    java.lang.String authentication,
                                                    java.lang.String baseName)
                                             throws javax.naming.NamingException
Returns a JNDI Context with the specified authentication information (principal, credential, and authentication) and baseName.

Parameters:
principal - Context.SECURITY_PRINCIPAL value
credential - Context.SECURITY_CREDENTIALS value
authentication - Context.SECURITY_AUTHENTICATION value
Throws:
javax.naming.NamingException - if failed to create a context