org.apache.ldap.server
Interface PartitionNexus

All Superinterfaces:
BackingStore
All Known Implementing Classes:
RootNexus

public interface PartitionNexus
extends BackingStore

The PartitionNexus is a special type of BackingStore designed to route BackingStore operations to ContextPartitions based on namespace to respective ContextPartitions attached to the nexus at the appropriate naming contexts. These naming contexts are also the suffixes of ContextPartitions. All entries within a ContextPartition have the same suffix. The PartitionNexus is a singleton where as ContextPartitions can be many hanging off of different contexts on the nexus. The PartitionNexus routes or proxies BackingStore calls to the appropriate PartitionContext implementation. It also provides some extended operations for the entire backend apparatus like listing the various naming contexts or partition suffixes within the system. The nexus is also responsibe for returning the entry Attributes for the root DSE when the approapriate search is conducted: empty filter String and base scope search.

Version:
$Rev: 159259 $
Author:
Apache Directory Project

Method Summary
 javax.naming.ldap.LdapContext getLdapContext()
          Gets the LdapContext associated with the calling thread.
 javax.naming.Name getMatchedDn(javax.naming.Name dn, boolean normalized)
          Gets the most significant Dn that exists within the server for any Dn.
 javax.naming.Name getSuffix(javax.naming.Name dn, boolean normalized)
          Gets the distinguished name of the suffix that would hold an entry with the supplied distinguished name parameter.
 java.util.Iterator listSuffixes(boolean normalized)
          Gets an iteration over the Name suffixes of the Backends managed by this BackendNexus.
 void register(ContextPartition partition)
          Registers an ContextPartition with this BackendManager.
 void unregister(ContextPartition partition)
          Unregisters an ContextPartition with this BackendManager.
 
Methods inherited from interface org.apache.ldap.server.BackingStore
add, close, delete, hasEntry, isClosed, isSuffix, list, lookup, lookup, modify, modify, modifyRn, move, move, search, sync
 

Method Detail

getLdapContext

public 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.

getMatchedDn

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

Parameters:
dn - 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 javax.naming.Name getSuffix(javax.naming.Name dn,
                                   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:
dn - 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 java.util.Iterator listSuffixes(boolean normalized)
                                throws javax.naming.NamingException
Gets an iteration over the Name suffixes of the Backends managed by this BackendNexus.

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

register

public void register(ContextPartition partition)
Registers an ContextPartition with this BackendManager. Called by each ContextPartition implementation after it has started to register for backend operation calls. This method effectively puts the ContextPartition's naming context online. Operations against the naming context should result in an LDAP BUSY result code in the returnValue if the naming context is not online.

Parameters:
partition - ContextPartition component to register with this BackendNexus.

unregister

public void unregister(ContextPartition partition)
Unregisters an ContextPartition with this BackendManager. Called for each registered Backend right befor it is to be stopped. This prevents protocol server requests from reaching the Backend and effectively puts the ContextPartition's naming context offline. Operations against the naming context should result in an LDAP BUSY result code in the returnValue if the naming context is not online.

Parameters:
partition - ContextPartition component to unregister with this BackendNexus.