org.apache.ldap.server.partition
Class DirectoryPartitionNexus

java.lang.Object
  extended by org.apache.ldap.server.partition.DirectoryPartitionNexus
All Implemented Interfaces:
DirectoryPartition
Direct Known Subclasses:
DefaultDirectoryPartitionNexus, DirectoryPartitionNexusProxy

public abstract class DirectoryPartitionNexus
extends java.lang.Object
implements DirectoryPartition

A root DirectoryPartition that contains all other partitions, and routes all operations to the child partition that matches to its base suffixes. It also provides some extended operations such as accessing rootDSE and listing base suffixes.

Version:
$Rev: 328323 $, $Date: 2005-10-25 06:08:31 -0400 (Tue, 25 Oct 2005) $
Author:
Apache Directory Project

Field Summary
static java.lang.String ADMIN_PASSWORD
          the initial admin passwd set on startup
static java.lang.String ADMIN_PRINCIPAL
          the default user principal or DN
static java.lang.String ADMIN_UID
          the admin super user uid
static java.lang.String GROUPS_BASE_NAME
          the base dn under which all groups reside
static java.lang.String SYSTEM_PARTITION_SUFFIX
          System backend suffix constant.
static java.lang.String USERS_BASE_NAME
          the base dn under which all users reside
 
Fields inherited from interface org.apache.ldap.server.partition.DirectoryPartition
ALIAS_ATTRIBUTE, ALIAS_OBJECT
 
Constructor Summary
DirectoryPartitionNexus()
           
 
Method Summary
abstract  void addContextPartition(DirectoryPartitionConfiguration config)
           
abstract  boolean compare(javax.naming.Name name, java.lang.String oid, java.lang.Object value)
          Performs a comparison check to see if an attribute of an entry has a specified value.
static javax.naming.Name getAdminName()
          Gets the DN for the admin user.
static javax.naming.Name getGroupsBaseName()
          Gets the DN for the base entry under which all groups reside.
abstract  javax.naming.ldap.LdapContext getLdapContext()
          Gets the LdapContext associated with the calling thread.
abstract  javax.naming.Name getMatchedName(javax.naming.Name name, boolean normalized)
          Gets the most significant Dn that exists within the server for any Dn.
abstract  javax.naming.directory.Attributes getRootDSE()
          Get's the RootDSE entry for the DSA.
abstract  javax.naming.Name getSuffix(javax.naming.Name name, boolean normalized)
          Gets the distinguished name of the suffix that would hold an entry with the supplied distinguished name parameter.
abstract  DirectoryPartition getSystemPartition()
           
static javax.naming.Name getUsersBaseName()
          Gets the DN for the base entry under which all non-admin users reside.
abstract  java.util.Iterator listSuffixes(boolean normalized)
          Gets an iteration over the Name suffixes of the Backends managed by this DirectoryPartitionNexus.
abstract  void removeContextPartition(javax.naming.Name suffix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.ldap.server.partition.DirectoryPartition
add, delete, destroy, getSuffix, hasEntry, init, isInitialized, isSuffix, list, lookup, lookup, modify, modify, modifyRn, move, move, search, sync
 

Field Detail

ADMIN_PRINCIPAL

public static final java.lang.String ADMIN_PRINCIPAL
the default user principal or DN

See Also:
Constant Field Values

ADMIN_UID

public static final java.lang.String ADMIN_UID
the admin super user uid

See Also:
Constant Field Values

ADMIN_PASSWORD

public static final java.lang.String ADMIN_PASSWORD
the initial admin passwd set on startup

See Also:
Constant Field Values

USERS_BASE_NAME

public static final java.lang.String USERS_BASE_NAME
the base dn under which all users reside

See Also:
Constant Field Values

GROUPS_BASE_NAME

public static final java.lang.String GROUPS_BASE_NAME
the base dn under which all groups reside

See Also:
Constant Field Values

SYSTEM_PARTITION_SUFFIX

public static final java.lang.String SYSTEM_PARTITION_SUFFIX
System backend suffix constant. Should be kept down to a single Dn name component or the default constructor will have to parse it instead of building the name. Note that what ever the SUFFIX equals it should be both the normalized and the user provided form.

See Also:
Constant Field Values
Constructor Detail

DirectoryPartitionNexus

public DirectoryPartitionNexus()
Method Detail

getAdminName

public static final javax.naming.Name getAdminName()
Gets the DN for the admin user.

Returns:
the admin user DN

getGroupsBaseName

public static final javax.naming.Name getGroupsBaseName()
Gets the DN for the base entry under which all groups reside. A new Name instance is created and returned every time.

Returns:
the groups base DN

getUsersBaseName

public static final javax.naming.Name getUsersBaseName()
Gets the DN for the base entry under which all non-admin users reside. A new Name instance is created and returned every time.

Returns:
the users base DN

getLdapContext

public abstract javax.naming.ldap.LdapContext getLdapContext()
Gets the LdapContext associated with the calling thread.

Returns:
The LdapContext associated with the thread of execution or null if no context is associated with the calling thread.

getRootDSE

public abstract javax.naming.directory.Attributes getRootDSE()
                                                      throws javax.naming.NamingException
Get's the RootDSE entry for the DSA.

Returns:
the attributes of the RootDSE
Throws:
javax.naming.NamingException

compare

public abstract boolean compare(javax.naming.Name name,
                                java.lang.String oid,
                                java.lang.Object value)
                         throws javax.naming.NamingException
Performs a comparison check to see if an attribute of an entry has a specified value.

Parameters:
name - the normalized name of the entry
oid - the attribute being compared
value - the value the attribute is compared to
Returns:
true if the entry contains an attribute with the value, false otherwise
Throws:
javax.naming.NamingException - if there is a problem accessing the entry and its values

addContextPartition

public abstract void addContextPartition(DirectoryPartitionConfiguration config)
                                  throws javax.naming.NamingException
Throws:
javax.naming.NamingException

removeContextPartition

public abstract void removeContextPartition(javax.naming.Name suffix)
                                     throws javax.naming.NamingException
Throws:
javax.naming.NamingException

getSystemPartition

public abstract DirectoryPartition getSystemPartition()

getMatchedName

public abstract javax.naming.Name getMatchedName(javax.naming.Name name,
                                                 boolean normalized)
                                          throws javax.naming.NamingException
Gets the most significant Dn that exists within the server for any Dn.

Parameters:
name - the normalized distinguished name to use for matching.
normalized - boolean if true cause the return of a normalized Dn, if false it returns the original user provided distinguished name for the matched portion of the Dn as it was provided on entry creation.
Returns:
a distinguished name representing the matching portion of dn, as originally provided by the user on creation of the matched entry or the empty string distinguished name if no match was found.
Throws:
javax.naming.NamingException - if there are any problems

getSuffix

public abstract javax.naming.Name getSuffix(javax.naming.Name name,
                                            boolean normalized)
                                     throws javax.naming.NamingException
Gets the distinguished name of the suffix that would hold an entry with the supplied distinguished name parameter. If the DN argument does not fall under a partition suffix then the empty string Dn is returned.

Parameters:
name - the normalized distinguished name to use for finding a suffix.
normalized - if true causes the return of a normalized Dn, but if false it returns the original user provided distinguished name for the suffix Dn as it was provided on suffix entry creation.
Returns:
the suffix portion of dn, or the valid empty string Dn if no naming context was found for dn.
Throws:
javax.naming.NamingException - if there are any problems

listSuffixes

public abstract java.util.Iterator listSuffixes(boolean normalized)
                                         throws javax.naming.NamingException
Gets an iteration over the Name suffixes of the Backends managed by this DirectoryPartitionNexus.

Parameters:
normalized - if true the returned Iterator contains normalized Dn but, if false, it returns the original user provided distinguished names in the Iterator.
Returns:
Iteration over ContextPartition suffix names as Names.
Throws:
javax.naming.NamingException - if there are any problems


Copyright © 2002-2005 . All Rights Reserved.