public class DefaultPartitionNexus extends AbstractPartition implements PartitionNexus
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.| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
ASF
the vendorName string proudly set to: Apache Software Foundation
|
private DirectoryService |
directoryService
The DirectoryService instance
|
private static java.lang.String |
ID
the fixed id: 'NEXUS'
|
private static boolean |
IS_DEBUG
Speedup for logs
|
private static org.slf4j.Logger |
LOG
A logger for this class
|
private java.util.List<org.apache.directory.api.ldap.model.entry.Modification> |
mods |
private org.apache.directory.api.ldap.util.tree.DnNode<Partition> |
partitionLookupTree
A structure to hold all the partitions
|
private java.util.Map<java.lang.String,Partition> |
partitions
the partitions keyed by normalized suffix strings
|
private org.apache.directory.api.ldap.model.entry.Entry |
rootDse
the read only rootDSE attributes
|
private org.apache.directory.api.ldap.model.name.Dn |
subschemSubentryDn
The cn=schema Dn
|
cacheService, contextEntry, ctxCsnChanged, dnFactory, id, initialized, schemaManager, suffixDnADMIN_PASSWORD_BYTES, ADMIN_PASSWORD_STRING, ADMIN_UIDDEFAULT_ID, ROOT_ID| Constructor and Description |
|---|
DefaultPartitionNexus(org.apache.directory.api.ldap.model.entry.Entry rootDse)
Creates the root nexus singleton of the entire system.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(AddOperationContext addContext)
Adds an entry to this ContextPartition.
|
void |
addContextPartition(Partition partition)
Add a partition to the server.
|
boolean |
compare(CompareOperationContext compareContext) |
private void |
createContextCsnModList() |
org.apache.directory.api.ldap.model.entry.Entry |
delete(DeleteOperationContext deleteContext)
Deletes a leaf entry from this ContextPartition: non-leaf entries cannot be
deleted until this operation has been applied to their children.
|
protected void |
doDestroy()
Override this method to put your initialization code.
|
protected void |
doInit()
Override this method to put your initialization code.
|
java.lang.String |
getContextCsn() |
DirectoryService |
getDirectoryService() |
Partition |
getPartition(org.apache.directory.api.ldap.model.name.Dn dn)
Get's the partition corresponding to a distinguished name.
|
org.apache.directory.api.ldap.model.entry.Entry |
getRootDse(GetRootDseOperationContext getRootDseContext)
Get's the RootDSE entry for the DSA.
|
org.apache.directory.api.ldap.model.entry.Value<?> |
getRootDseValue(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Get's the RootDSE value associated with an AttributeType
|
org.apache.directory.api.ldap.model.name.Dn |
getSuffixDn(org.apache.directory.api.ldap.model.name.Dn dn)
Finds the distinguished name of the suffix that would hold an entry with
the supplied distinguished name parameter.
|
boolean |
hasEntry(HasEntryOperationContext hasEntryContext)
Fast operation to check and see if a particular entry exists.
|
java.util.Set<java.lang.String> |
listSuffixes()
Gets an iteration over the Name suffixes of the partitions managed by this
DefaultPartitionNexus. |
org.apache.directory.api.ldap.model.entry.Entry |
lookup(LookupOperationContext lookupContext)
Looks up an entry by distinguished/absolute name.
|
void |
modify(ModifyOperationContext modifyContext)
Modifies an entry by adding, removing or replacing a set of attributes.
|
void |
move(MoveOperationContext moveContext)
Transplants a child entry, to a position in the namespace under a new
parent entry.
|
void |
moveAndRename(MoveAndRenameOperationContext moveAndRenameContext)
Transplants a child entry, to a position in the namespace under a new
parent entry and changes the RN of the child entry which can optionally
have its old RN attributes removed.
|
void |
registerSupportedExtensions(java.util.Set<java.lang.String> extensionOids)
Adds a set of supportedExtension (OID Strings) to the RootDSE.
|
void |
registerSupportedSaslMechanisms(java.util.Set<java.lang.String> supportedSaslMechanisms)
Adds a set of supportedSaslMechanisms (OID Strings) to the RootDSE.
|
void |
removeContextPartition(org.apache.directory.api.ldap.model.name.Dn partitionDn)
Remove a partition from the server.
|
void |
rename(RenameOperationContext renameContext)
Modifies an entry by changing its relative name.
|
void |
saveContextCsn()
saves the context CSN value in the context entry of the partition
|
EntryFilteringCursor |
search(SearchOperationContext searchContext)
Conducts a search against this ContextPartition.
|
private EntryFilteringCursor |
searchFromRoot(SearchOperationContext searchContext)
Do a search from the root of the DIT.
|
private EntryFilteringCursor |
searchRootDse(SearchOperationContext searchContext) |
void |
setDirectoryService(DirectoryService directoryService) |
void |
setId(java.lang.String id)
Sets the unique identifier for this partition.
|
void |
setSuffixDn(org.apache.directory.api.ldap.model.name.Dn suffix)
Sets the suffix Dn, must be normalized.
|
void |
sync()
Flushes any changes made to this partition now.
|
void |
unbind(UnbindOperationContext unbindContext)
Represents an unbind operation issued by an authenticated client.
|
private void |
unregister(Partition partition)
Unregisters an ContextPartition with this BackendManager.
|
checkInitialized, destroy, dumpIndex, getContextEntry, getId, getSchemaManager, getSuffixDn, initialize, isInitialized, setCacheService, setContextCsn, setContextEntry, setSchemaManagerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, dumpIndex, getId, getSchemaManager, getSuffixDn, initialize, isInitialized, setCacheService, setSchemaManagerprivate static final org.slf4j.Logger LOG
private static final java.lang.String ID
private static final boolean IS_DEBUG
private static final java.lang.String ASF
private final org.apache.directory.api.ldap.model.entry.Entry rootDse
private DirectoryService directoryService
private java.util.Map<java.lang.String,Partition> partitions
private org.apache.directory.api.ldap.util.tree.DnNode<Partition> partitionLookupTree
private final java.util.List<org.apache.directory.api.ldap.model.entry.Modification> mods
private org.apache.directory.api.ldap.model.name.Dn subschemSubentryDn
public DefaultPartitionNexus(org.apache.directory.api.ldap.model.entry.Entry rootDse)
throws java.lang.Exception
rootDse - the root entry for the DSAjavax.naming.Exception - on failure to initializejava.lang.Exceptionprotected void doInit()
throws java.lang.Exception
AbstractPartitiondoInit in class AbstractPartitionjava.lang.Exceptionprotected void doDestroy()
AbstractPartitiondoDestroy in class AbstractPartitionpublic void setId(java.lang.String id)
setId in interface PartitionsetId in class AbstractPartitionid - the unique identifier for this partitionpublic void setSuffixDn(org.apache.directory.api.ldap.model.name.Dn suffix)
setSuffixDn in interface PartitionsetSuffixDn in class AbstractPartitionsuffix - the new suffix Dnpublic void sync()
throws java.lang.Exception
Partitionpublic void add(AddOperationContext addContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public boolean compare(CompareOperationContext compareContext) throws org.apache.directory.api.ldap.model.exception.LdapException
compare in interface PartitionNexusorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic org.apache.directory.api.ldap.model.entry.Entry delete(DeleteOperationContext deleteContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public boolean hasEntry(HasEntryOperationContext hasEntryContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public org.apache.directory.api.ldap.model.entry.Entry lookup(LookupOperationContext lookupContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public void modify(ModifyOperationContext modifyContext) throws org.apache.directory.api.ldap.model.exception.LdapException
modify in interface PartitionmodifyContext - The context containing the modification operation
to perform on the entry which is one of constants specified by the
DirContext interface:
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE.org.apache.directory.api.ldap.model.exception.LdapExceptionDirContext,
DirContext.ADD_ATTRIBUTE,
DirContext.REMOVE_ATTRIBUTE,
DirContext.REPLACE_ATTRIBUTEpublic void move(MoveOperationContext moveContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public void moveAndRename(MoveAndRenameOperationContext moveAndRenameContext) throws org.apache.directory.api.ldap.model.exception.LdapException
moveAndRename in interface PartitionmoveAndRenameContext - The context contain all the information about
the modifyDN operationorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic void rename(RenameOperationContext renameContext) throws org.apache.directory.api.ldap.model.exception.LdapException
private EntryFilteringCursor searchRootDse(SearchOperationContext searchContext) throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapExceptionpublic EntryFilteringCursor search(SearchOperationContext searchContext) throws org.apache.directory.api.ldap.model.exception.LdapException
private EntryFilteringCursor searchFromRoot(SearchOperationContext searchContext) throws org.apache.directory.api.ldap.model.exception.LdapException
searchContext - org.apache.directory.api.ldap.model.exception.LdapExceptionpublic void unbind(UnbindOperationContext unbindContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public org.apache.directory.api.ldap.model.entry.Entry getRootDse(GetRootDseOperationContext getRootDseContext)
getRootDse in interface PartitionNexuspublic org.apache.directory.api.ldap.model.entry.Value<?> getRootDseValue(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
getRootDseValue in interface PartitionNexusattributeType - The attribute type for which we want a valuepublic void addContextPartition(Partition partition) throws org.apache.directory.api.ldap.model.exception.LdapException
addContextPartition in interface PartitionNexusorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic void removeContextPartition(org.apache.directory.api.ldap.model.name.Dn partitionDn)
throws org.apache.directory.api.ldap.model.exception.LdapException
removeContextPartition in interface PartitionNexuspartitionDn - the partition Dnorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic Partition getPartition(org.apache.directory.api.ldap.model.name.Dn dn) throws org.apache.directory.api.ldap.model.exception.LdapException
getPartition in interface PartitionNexusdn - the normalized distinguished name to get a partition fororg.apache.directory.api.ldap.model.exception.LdapExceptionpublic org.apache.directory.api.ldap.model.name.Dn getSuffixDn(org.apache.directory.api.ldap.model.name.Dn dn)
throws org.apache.directory.api.ldap.model.exception.LdapException
getSuffixDn in interface PartitionNexusorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic java.util.Set<java.lang.String> listSuffixes()
throws org.apache.directory.api.ldap.model.exception.LdapException
PartitionNexusDefaultPartitionNexus.listSuffixes in interface PartitionNexusorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic void registerSupportedExtensions(java.util.Set<java.lang.String> extensionOids)
throws org.apache.directory.api.ldap.model.exception.LdapException
registerSupportedExtensions in interface PartitionNexusextensionOids - a set of OID strings to add to the supportedExtension
attribute in the RootDSEorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic void registerSupportedSaslMechanisms(java.util.Set<java.lang.String> supportedSaslMechanisms)
throws org.apache.directory.api.ldap.model.exception.LdapException
registerSupportedSaslMechanisms in interface PartitionNexusorg.apache.directory.api.ldap.model.exception.LdapExceptionprivate void unregister(Partition partition) throws java.lang.Exception
partition - ContextPartition component to unregister with this
BackendNexus.java.lang.Exception - if there are problems unregistering the partitionpublic DirectoryService getDirectoryService()
public void setDirectoryService(DirectoryService directoryService)
directoryService - the directoryService to setprivate void createContextCsnModList()
throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapExceptionpublic java.lang.String getContextCsn()
AbstractPartitiongetContextCsn in interface PartitiongetContextCsn in class AbstractPartitionpublic void saveContextCsn()
throws java.lang.Exception
PartitionsaveContextCsn in interface Partitionjava.lang.Exception