org.apache.ldap.server.jndi
Class CoreContextFactory

java.lang.Object
  extended byorg.apache.ldap.server.jndi.CoreContextFactory
All Implemented Interfaces:
javax.naming.spi.InitialContextFactory
Direct Known Subclasses:
ServerContextFactory

public class CoreContextFactory
extends java.lang.Object
implements javax.naming.spi.InitialContextFactory

A server-side provider implementation of a InitialContextFactory. Can be utilized via JNDI API in the standard fashion: Hashtable env = new Hashtable(); env.put( Context.PROVIDER_URL, "ou=system" ); env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.CoreContextFactory" ); InitialContext initialContext = new InitialContext( env );

Version:
$Rev$
Author:
Apache Directory Project
See Also:
InitialContextFactory

Field Summary
protected static java.lang.String ADMIN
          shorthand reference to the admin principal name
protected static javax.naming.Name ADMIN_NAME
          shorthand reference to the admin principal distinguished name
protected  boolean createMode
          whether or not server is started for the first time
protected static java.lang.String[] DEFAULT_SCHEMAS
          default schema classes for the SCHEMAS_ENV property if not set
static java.lang.String DEFAULT_WKDIR
          default path to working directory if WKDIR_ENV property is not set
protected  GlobalRegistries globalRegistries
          the registries for system schema objects
protected  java.util.Hashtable initialEnv
          the initial context environment that fired up the backend subsystem
protected  RootNexus nexus
          the root nexus
protected static java.lang.String PRINCIPAL
          shorthand reference to the authentication principal property
protected  JndiProvider provider
          The singleton JndiProvider instance
protected  SystemPartition system
          the system partition used by the context factory
 
Constructor Summary
CoreContextFactory()
          Default constructor that sets the provider of this ServerContextFactory.
 
Method Summary
protected  void checkSecuritySettings(java.util.Hashtable env)
          Checks to make sure security environment parameters are set correctly.
 javax.naming.Context getInitialContext(java.util.Hashtable env)
           
protected  void initialize()
          Kicks off the initialization of the entire system.
protected  boolean isAnonymous(java.util.Hashtable env)
          Checks to see if an anonymous bind is being attempted.
protected  boolean mkdirs(java.lang.String base, java.lang.String path)
          Recursively creates a bunch of directories from a base down to a path.
protected  void startUpAppPartitions(java.lang.String eveWkdir)
          Starts up all the application partitions that will be attached to naming contexts in the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRINCIPAL

protected static final java.lang.String PRINCIPAL
shorthand reference to the authentication principal property

See Also:
Constant Field Values

ADMIN

protected static final java.lang.String ADMIN
shorthand reference to the admin principal name

See Also:
Constant Field Values

ADMIN_NAME

protected static final javax.naming.Name ADMIN_NAME
shorthand reference to the admin principal distinguished name


DEFAULT_WKDIR

public static final java.lang.String DEFAULT_WKDIR
default path to working directory if WKDIR_ENV property is not set

See Also:
Constant Field Values

DEFAULT_SCHEMAS

protected static final java.lang.String[] DEFAULT_SCHEMAS
default schema classes for the SCHEMAS_ENV property if not set


provider

protected JndiProvider provider
The singleton JndiProvider instance


initialEnv

protected java.util.Hashtable initialEnv
the initial context environment that fired up the backend subsystem


system

protected SystemPartition system
the system partition used by the context factory


globalRegistries

protected GlobalRegistries globalRegistries
the registries for system schema objects


nexus

protected RootNexus nexus
the root nexus


createMode

protected boolean createMode
whether or not server is started for the first time

Constructor Detail

CoreContextFactory

public CoreContextFactory()
Default constructor that sets the provider of this ServerContextFactory.

Method Detail

getInitialContext

public javax.naming.Context getInitialContext(java.util.Hashtable env)
                                       throws javax.naming.NamingException
Specified by:
getInitialContext in interface javax.naming.spi.InitialContextFactory
Throws:
javax.naming.NamingException

checkSecuritySettings

protected void checkSecuritySettings(java.util.Hashtable env)
                              throws javax.naming.NamingException
Checks to make sure security environment parameters are set correctly.

Throws:
javax.naming.NamingException - if the security settings are not correctly configured.

isAnonymous

protected boolean isAnonymous(java.util.Hashtable env)
Checks to see if an anonymous bind is being attempted.

Returns:
true if bind is anonymous, false otherwise

initialize

protected void initialize()
                   throws javax.naming.NamingException
Kicks off the initialization of the entire system.

Throws:
javax.naming.NamingException - if there are problems along the way

startUpAppPartitions

protected void startUpAppPartitions(java.lang.String eveWkdir)
                             throws javax.naming.NamingException
Starts up all the application partitions that will be attached to naming contexts in the system. Partition database files are created within a subdirectory immediately under the Eve working directory base.

Parameters:
eveWkdir - the base Eve working directory
Throws:
javax.naming.NamingException - if there are problems creating and starting these new application partitions

mkdirs

protected boolean mkdirs(java.lang.String base,
                         java.lang.String path)
Recursively creates a bunch of directories from a base down to a path.

Parameters:
base - the base directory to start at
path - the path to recursively create if we have to
Returns:
true if the target directory has been created or exists, false if we fail along the way somewhere