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.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.
|
PartitionReadTxn |
beginReadTransaction()
Start a read transaction
|
PartitionWriteTxn |
beginWriteTransaction()
Start a write transaction
|
boolean |
compare(CompareOperationContext compareContext)
The Compare operation
|
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(PartitionTxn partitionTxn)
Override this method to put your initialization code.
|
protected void |
doInit()
Override this method to put your initialization code.
|
protected void |
doRepair()
Override this method to implement a repair method
|
String |
getContextCsn(PartitionTxn partitionTxn)
Get the contextCSN
|
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
|
Subordinates |
getSubordinates(PartitionTxn partitionTxn,
org.apache.directory.api.ldap.model.entry.Entry entry)
Return the number of children and subordinates for a given entry
|
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(String partitionDn)
Remove a partition from the server.
|
void |
rename(RenameOperationContext renameContext)
Modifies an entry by changing its relative name.
|
void |
repair()
Repair this partition.
|
void |
saveContextCsn(PartitionTxn partitionTxn)
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, setContextCsn, setContextEntry, setSchemaManager
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, dumpIndex, getId, getSchemaManager, getSuffixDn, initialize, isInitialized, setSchemaManager
public DefaultPartitionNexus(org.apache.directory.api.ldap.model.entry.Entry rootDse) throws org.apache.directory.api.ldap.model.exception.LdapException
rootDse
- the root entry for the DSAorg.apache.directory.api.ldap.model.exception.LdapException
- on failure to initializepublic void repair() throws org.apache.directory.api.ldap.model.exception.LdapException
repair
in interface Partition
repair
in class AbstractPartition
org.apache.directory.api.ldap.model.exception.LdapException
protected void doRepair() throws org.apache.directory.api.ldap.model.exception.LdapException
doRepair
in class AbstractPartition
org.apache.directory.api.ldap.model.exception.LdapException
- If the repair failedprotected void doInit() throws org.apache.directory.api.ldap.model.exception.LdapException
doInit
in class AbstractPartition
org.apache.directory.api.ldap.model.exception.LdapException
- If the initialization failedprotected void doDestroy(PartitionTxn partitionTxn)
doDestroy
in class AbstractPartition
partitionTxn
- The transaction to usepublic 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 org.apache.directory.api.ldap.model.exception.LdapException
sync
in interface Partition
sync
in class AbstractPartition
org.apache.directory.api.ldap.model.exception.LdapException
- if buffers cannot be flushed to diskpublic 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
compareContext
- The context for the compare operationorg.apache.directory.api.ldap.model.exception.LdapException
- If we had an issue during the operationpublic 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
- if there are any problemspublic 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
- if there are any problemspublic 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
getRootDseContext
- The operation contextpublic 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
partition
- The Partition to addorg.apache.directory.api.ldap.model.exception.LdapException
- If the addition can't be donepublic void removeContextPartition(String 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
- If the removal can't be donepublic 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
- if there is no partition for the dnpublic 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
dn
- The Dn we want to find the suffix fromorg.apache.directory.api.ldap.model.exception.LdapException
- If we can't get the suffix Dnpublic Set<String> listSuffixes() throws org.apache.directory.api.ldap.model.exception.LdapException
PartitionNexus
listSuffixes
in interface PartitionNexus
org.apache.directory.api.ldap.model.exception.LdapException
- if there are any problemspublic 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
- If we cannot register the extensionspublic void registerSupportedSaslMechanisms(Set<String> supportedSaslMechanisms) throws org.apache.directory.api.ldap.model.exception.LdapException
registerSupportedSaslMechanisms
in interface PartitionNexus
supportedSaslMechanisms
- a set of OID strings to add to the supportedSaslMechanisms
attribute in the RootDSEorg.apache.directory.api.ldap.model.exception.LdapException
- If we cannot fetch the supported SASL mechanismpublic DirectoryService getDirectoryService()
public void setDirectoryService(DirectoryService directoryService)
directoryService
- the directoryService to setpublic String getContextCsn(PartitionTxn partitionTxn)
getContextCsn
in interface Partition
getContextCsn
in class AbstractPartition
partitionTxn
- The transaction to usepublic void saveContextCsn(PartitionTxn partitionTxn) throws org.apache.directory.api.ldap.model.exception.LdapException
Partition
saveContextCsn
in interface Partition
partitionTxn
- The transaction to useorg.apache.directory.api.ldap.model.exception.LdapException
- If the context can't be savedpublic Subordinates getSubordinates(PartitionTxn partitionTxn, org.apache.directory.api.ldap.model.entry.Entry entry) throws org.apache.directory.api.ldap.model.exception.LdapException
getSubordinates
in interface Partition
partitionTxn
- The Partition transactionentry
- The entry for which we want to find the subordinatesorg.apache.directory.api.ldap.model.exception.LdapException
- If we had an issue while processing the requestpublic PartitionReadTxn beginReadTransaction()
Partition
beginReadTransaction
in interface Partition
public PartitionWriteTxn beginWriteTransaction()
Partition
beginWriteTransaction
in interface Partition
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.