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.cacheService, contextEntry, ctxCsnChanged, dnFactory, id, initialized, schemaManager, suffixDn
ADMIN_PASSWORD_BYTES, ADMIN_PASSWORD_STRING, ADMIN_UID
DEFAULT_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) |
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.
|
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.
|
Set<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(Set<String> extensionOids)
Adds a set of supportedExtension (OID Strings) to the RootDSE.
|
void |
registerSupportedSaslMechanisms(Set<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.
|
void |
setDirectoryService(DirectoryService directoryService) |
void |
setId(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.
|
checkInitialized, destroy, dumpIndex, getContextEntry, getId, getSchemaManager, getSuffixDn, initialize, isInitialized, setCacheService, setContextCsn, setContextEntry, setSchemaManager
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, dumpIndex, getId, getSchemaManager, getSuffixDn, initialize, isInitialized, setCacheService, setSchemaManager
public DefaultPartitionNexus(org.apache.directory.api.ldap.model.entry.Entry rootDse) throws Exception
rootDse
- the root entry for the DSAjavax.naming.Exception
- on failure to initializeException
protected void doInit() throws Exception
AbstractPartition
doInit
in class AbstractPartition
Exception
protected void doDestroy()
AbstractPartition
doDestroy
in class AbstractPartition
public void setId(String id)
setId
in interface Partition
setId
in class AbstractPartition
id
- the unique identifier for this partitionpublic void setSuffixDn(org.apache.directory.api.ldap.model.name.Dn suffix)
setSuffixDn
in interface Partition
setSuffixDn
in class AbstractPartition
suffix
- the new suffix Dnpublic void sync() throws Exception
Partition
public 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 PartitionNexus
org.apache.directory.api.ldap.model.exception.LdapException
public 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 Partition
modifyContext
- 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.LdapException
DirContext
,
DirContext.ADD_ATTRIBUTE
,
DirContext.REMOVE_ATTRIBUTE
,
DirContext.REPLACE_ATTRIBUTE
public 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 Partition
moveAndRenameContext
- The context contain all the information about
the modifyDN operationorg.apache.directory.api.ldap.model.exception.LdapException
public void rename(RenameOperationContext renameContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public EntryFilteringCursor search(SearchOperationContext searchContext) throws org.apache.directory.api.ldap.model.exception.LdapException
public 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 PartitionNexus
public org.apache.directory.api.ldap.model.entry.Value<?> getRootDseValue(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
getRootDseValue
in interface PartitionNexus
attributeType
- 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 PartitionNexus
org.apache.directory.api.ldap.model.exception.LdapException
public void removeContextPartition(org.apache.directory.api.ldap.model.name.Dn partitionDn) throws org.apache.directory.api.ldap.model.exception.LdapException
removeContextPartition
in interface PartitionNexus
partitionDn
- the partition Dnorg.apache.directory.api.ldap.model.exception.LdapException
public Partition getPartition(org.apache.directory.api.ldap.model.name.Dn dn) throws org.apache.directory.api.ldap.model.exception.LdapException
getPartition
in interface PartitionNexus
dn
- the normalized distinguished name to get a partition fororg.apache.directory.api.ldap.model.exception.LdapException
public 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 PartitionNexus
org.apache.directory.api.ldap.model.exception.LdapException
public Set<String> listSuffixes() throws org.apache.directory.api.ldap.model.exception.LdapException
PartitionNexus
DefaultPartitionNexus
.listSuffixes
in interface PartitionNexus
org.apache.directory.api.ldap.model.exception.LdapException
public void registerSupportedExtensions(Set<String> extensionOids) throws org.apache.directory.api.ldap.model.exception.LdapException
registerSupportedExtensions
in interface PartitionNexus
extensionOids
- a set of OID strings to add to the supportedExtension
attribute in the RootDSEorg.apache.directory.api.ldap.model.exception.LdapException
public void registerSupportedSaslMechanisms(Set<String> supportedSaslMechanisms) throws org.apache.directory.api.ldap.model.exception.LdapException
registerSupportedSaslMechanisms
in interface PartitionNexus
org.apache.directory.api.ldap.model.exception.LdapException
public DirectoryService getDirectoryService()
public void setDirectoryService(DirectoryService directoryService)
directoryService
- the directoryService to setpublic String getContextCsn()
AbstractPartition
getContextCsn
in interface Partition
getContextCsn
in class AbstractPartition
public void saveContextCsn() throws Exception
Partition
saveContextCsn
in interface Partition
Exception
Copyright © 2017. All rights reserved.