org.apache.directory.server.core.partition
Class PartitionNexus

java.lang.Object
  extended by org.apache.directory.server.core.partition.PartitionNexus
All Implemented Interfaces:
Partition
Direct Known Subclasses:
DefaultPartitionNexus, PartitionNexusProxy

public abstract class PartitionNexus
extends java.lang.Object
implements Partition

A root Partition 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: 664295 $, $Date: 2008-06-07 09:48:16 +0200 (Sa, 07 Jun 2008) $
Author:
Apache Directory Project

Field Summary
static byte[] ADMIN_PASSWORD_BYTES
           
static java.lang.String ADMIN_PASSWORD_STRING
          the initial admin passwd set on startup
static java.lang.String ADMIN_UID
          the admin super user uid
 
Fields inherited from interface org.apache.directory.server.core.partition.Partition
DEFAULT_CACHE_SIZE, DEFAULT_PARTITION_IMPLEMENTATION, SYSTEM_PARTITION_NAME
 
Constructor Summary
PartitionNexus()
           
 
Method Summary
abstract  void addContextPartition(AddContextPartitionOperationContext opContext)
           
abstract  boolean compare(CompareOperationContext compareContext)
          Performs a comparison check to see if an attribute of an entry has a specified value.
static org.apache.directory.shared.ldap.name.LdapDN getAdminName()
          Gets the DN for the admin user.
static org.apache.directory.shared.ldap.name.LdapDN 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  org.apache.directory.shared.ldap.name.LdapDN getMatchedName(GetMatchedNameOperationContext getMatchedNameContext)
          Gets the most significant Dn that exists within the server for any Dn.
abstract  Partition getPartition(org.apache.directory.shared.ldap.name.LdapDN dn)
          Get's the partition corresponding to a distinguished name.
abstract  ClonedServerEntry getRootDSE(GetRootDSEOperationContext opContext)
          Get's the RootDSE entry for the DSA.
abstract  org.apache.directory.shared.ldap.name.LdapDN getSuffix(GetSuffixOperationContext suffixContext)
          Gets the distinguished name of the suffix that would hold an entry with the supplied distinguished name parameter.
abstract  Partition getSystemPartition()
           
static org.apache.directory.shared.ldap.name.LdapDN getUsersBaseName()
          Gets the DN for the base entry under which all non-admin users reside.
abstract  java.util.Iterator<java.lang.String> listSuffixes(ListSuffixOperationContext opContext)
          Gets an iteration over the Name suffixes of the partitions managed by this PartitionNexus.
abstract  void registerSupportedExtensions(java.util.Set<java.lang.String> extensionOids)
          Adds a set of supportedExtension (OID Strings) to the RootDSE.
abstract  void registerSupportedSaslMechanisms(java.util.Set<java.lang.String> strings)
           
abstract  void removeContextPartition(RemoveContextPartitionOperationContext opContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.directory.server.core.partition.Partition
add, bind, delete, destroy, getCacheSize, getId, getSuffix, getSuffixDn, getUpSuffixDn, hasEntry, init, isInitialized, list, lookup, lookup, modify, move, moveAndRename, rename, search, setCacheSize, setId, setSuffix, sync, unbind
 

Field Detail

ADMIN_UID

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

See Also:
Constant Field Values

ADMIN_PASSWORD_STRING

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

See Also:
Constant Field Values

ADMIN_PASSWORD_BYTES

public static final byte[] ADMIN_PASSWORD_BYTES
Constructor Detail

PartitionNexus

public PartitionNexus()
Method Detail

getAdminName

public static final org.apache.directory.shared.ldap.name.LdapDN getAdminName()
Gets the DN for the admin user.

Returns:
the admin user DN

getGroupsBaseName

public static final org.apache.directory.shared.ldap.name.LdapDN 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 org.apache.directory.shared.ldap.name.LdapDN 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 ClonedServerEntry getRootDSE(GetRootDSEOperationContext opContext)
                                      throws java.lang.Exception
Get's the RootDSE entry for the DSA.

Returns:
the attributes of the RootDSE
Throws:
java.lang.Exception

compare

public abstract boolean compare(CompareOperationContext compareContext)
                         throws java.lang.Exception
Performs a comparison check to see if an attribute of an entry has a specified value.

Parameters:
compareContext - the context used to compare
Returns:
true if the entry contains an attribute with the value, false otherwise
Throws:
java.lang.Exception - if there is a problem accessing the entry and its values
java.lang.Exception

addContextPartition

public abstract void addContextPartition(AddContextPartitionOperationContext opContext)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

removeContextPartition

public abstract void removeContextPartition(RemoveContextPartitionOperationContext opContext)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

getSystemPartition

public abstract Partition getSystemPartition()

getPartition

public abstract Partition getPartition(org.apache.directory.shared.ldap.name.LdapDN dn)
                                throws java.lang.Exception
Get's the partition corresponding to a distinguished name. This name need not be the name of the partition suffix. When used in conjunction with get suffix this can properly find the partition associated with the DN. Make sure to use the normalized DN.

Parameters:
dn - the normalized distinguished name to get a partition for
Returns:
the partition containing the entry represented by the dn
Throws:
java.lang.Exception - if there is no partition for the dn

getMatchedName

public abstract org.apache.directory.shared.ldap.name.LdapDN getMatchedName(GetMatchedNameOperationContext getMatchedNameContext)
                                                                     throws java.lang.Exception
Gets the most significant Dn that exists within the server for any Dn.

Parameters:
getMatchedNameContext - the context containing the distinguished name to use for matching.
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:
java.lang.Exception - if there are any problems

getSuffix

public abstract org.apache.directory.shared.ldap.name.LdapDN getSuffix(GetSuffixOperationContext suffixContext)
                                                                throws java.lang.Exception
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:
suffixContext - the Context containing normalized distinguished name to use for finding a suffix.
Returns:
the suffix portion of dn, or the valid empty string Dn if no naming context was found for dn.
Throws:
java.lang.Exception - if there are any problems

listSuffixes

public abstract java.util.Iterator<java.lang.String> listSuffixes(ListSuffixOperationContext opContext)
                                                           throws java.lang.Exception
Gets an iteration over the Name suffixes of the partitions managed by this PartitionNexus.

Returns:
Iteration over ContextPartition suffix names as Names.
Throws:
java.lang.Exception - if there are any problems

registerSupportedExtensions

public abstract void registerSupportedExtensions(java.util.Set<java.lang.String> extensionOids)
                                          throws java.lang.Exception
Adds a set of supportedExtension (OID Strings) to the RootDSE.

Parameters:
extensionOids - a set of OID strings to add to the supportedExtension attribute in the RootDSE
Throws:
java.lang.Exception

registerSupportedSaslMechanisms

public abstract void registerSupportedSaslMechanisms(java.util.Set<java.lang.String> strings)
                                              throws java.lang.Exception
Throws:
java.lang.Exception


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