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.ADMIN_PASSWORD_BYTES, ADMIN_PASSWORD_STRING, ADMIN_UID
Constructor and Description |
---|
DefaultPartitionNexus(org.apache.directory.shared.ldap.entry.ServerEntry 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(AddContextPartitionOperationContext opContext)
Add a partition to the server.
|
void |
bind(BindOperationContext bindContext)
Represents a bind operation issued to authenticate a client.
|
boolean |
compare(CompareOperationContext compareContext) |
void |
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.
|
DirectoryService |
getDirectoryService() |
String |
getId()
Gets the unique identifier for this partition.
|
org.apache.directory.shared.ldap.name.DN |
getMatchedName(GetMatchedNameOperationContext matchedNameContext)
Gets the most significant Dn that exists within the server for any Dn.
|
Partition |
getPartition(org.apache.directory.shared.ldap.name.DN dn)
Get's the partition corresponding to a distinguished name.
|
ClonedServerEntry |
getRootDSE(GetRootDSEOperationContext getRootDSEContext)
Get's the RootDSE entry for the DSA.
|
org.apache.directory.shared.ldap.schema.SchemaManager |
getSchemaManager()
Gets the schema manager assigned to this Partition.
|
String |
getSuffix()
Gets the user provided suffix for this Partition as a String.
|
org.apache.directory.shared.ldap.name.DN |
getSuffix(GetSuffixOperationContext getSuffixContext)
Gets the distinguished name of the suffix that would hold an entry with
the supplied distinguished name parameter.
|
org.apache.directory.shared.ldap.name.DN |
getSuffixDn()
Gets the normalized suffix as an DN for this Partition after it has
been initialized.
|
Partition |
getSystemPartition() |
boolean |
hasEntry(EntryOperationContext opContext)
This method calls
Partition.lookup(LookupOperationContext) and return true
if it returns an entry by default. |
boolean |
isInitialized()
Returns true if this context partition is initialized successfully.
|
EntryFilteringCursor |
list(ListOperationContext opContext)
A specialized form of one level search used to return a minimal set of
information regarding child entries under a base.
|
Set<String> |
listSuffixes(ListSuffixOperationContext emptyContext)
Gets an iteration over the Name suffixes of the partitions managed by this
DefaultPartitionNexus . |
ClonedServerEntry |
lookup(Long id) |
ClonedServerEntry |
lookup(LookupOperationContext opContext)
This method calls
Partition.lookup(LookupOperationContext)
with null attributeIds by default. |
void |
modify(ModifyOperationContext modifyContext)
Modifies an entry by adding, removing or replacing a set of attributes.
|
void |
move(MoveOperationContext opContext)
Transplants a child entry, to a position in the namespace under a new
parent entry.
|
void |
moveAndRename(MoveAndRenameOperationContext opContext)
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(RemoveContextPartitionOperationContext removeContextPartition)
Remove a partition from the server.
|
void |
rename(RenameOperationContext opContext)
Modifies an entry by changing its relative name.
|
EntryFilteringCursor |
search(SearchOperationContext opContext)
Conducts a search against this ContextPartition.
|
void |
setDirectoryService(DirectoryService directoryService) |
void |
setId(String id)
Sets the unique identifier for this partition.
|
void |
setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
Sets the schema manager assigned to this Partition.
|
void |
setSuffix(String suffix)
Sets the user provided suffix for this Partition as a String.
|
void |
sync()
This method does nothing by default.
|
void |
unbind(UnbindOperationContext unbindContext)
Represents an unbind operation issued by an authenticated client.
|
destroy, initialize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, initialize
public DefaultPartitionNexus(org.apache.directory.shared.ldap.entry.ServerEntry 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 String getId()
Partition
public void setId(String id)
Partition
public org.apache.directory.shared.ldap.schema.SchemaManager getSchemaManager()
getSchemaManager
in interface Partition
public void setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
setSchemaManager
in interface Partition
public org.apache.directory.shared.ldap.name.DN getSuffixDn()
Partition
getSuffixDn
in interface Partition
public String getSuffix()
Partition
public void setSuffix(String suffix)
Partition
public boolean isInitialized()
AbstractPartition
isInitialized
in interface Partition
isInitialized
in class AbstractPartition
public void sync() throws Exception
AbstractPartition
sync
in interface Partition
sync
in class AbstractPartition
Exception
- if buffers cannot be flushed to diskpublic void add(AddOperationContext addContext) throws Exception
Partition
public void bind(BindOperationContext bindContext) throws Exception
Partition
public boolean compare(CompareOperationContext compareContext) throws Exception
compare
in interface PartitionNexus
Exception
public void delete(DeleteOperationContext deleteContext) throws Exception
Partition
public boolean hasEntry(EntryOperationContext opContext) throws Exception
AbstractPartition
Partition.lookup(LookupOperationContext)
and return true
if it returns an entry by default. Please override this method if
there is more effective way for your implementation.hasEntry
in interface Partition
hasEntry
in class AbstractPartition
opContext
- The context used to pass informationsException
- if there are any problemspublic EntryFilteringCursor list(ListOperationContext opContext) throws Exception
Partition
list
in interface Partition
opContext
- the context containing the distinguished/absolute name for the search/listingServerSearchResult
Exception
- if there are any problemspublic ClonedServerEntry lookup(LookupOperationContext opContext) throws Exception
AbstractPartition
Partition.lookup(LookupOperationContext)
with null attributeIds by default. Please override
this method if there is more effective way for your implementation.lookup
in interface Partition
lookup
in class AbstractPartition
opContext
- The context containing the parametersException
- if there are any problemspublic ClonedServerEntry lookup(Long id) throws Exception
Exception
public void modify(ModifyOperationContext modifyContext) throws Exception
Partition
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
.Exception
- if there are any problemsDirContext
,
DirContext.ADD_ATTRIBUTE
,
DirContext.REMOVE_ATTRIBUTE
,
DirContext.REPLACE_ATTRIBUTE
public void move(MoveOperationContext opContext) throws Exception
Partition
public void moveAndRename(MoveAndRenameOperationContext opContext) throws Exception
Partition
moveAndRename
in interface Partition
opContext
- The context contain all the information about
the modifyDN operationException
- if there are any problemspublic void rename(RenameOperationContext opContext) throws Exception
Partition
public EntryFilteringCursor search(SearchOperationContext opContext) throws Exception
Partition
public void unbind(UnbindOperationContext unbindContext) throws Exception
Partition
public ClonedServerEntry getRootDSE(GetRootDSEOperationContext getRootDSEContext)
PartitionNexus
getRootDSE
in interface PartitionNexus
public void addContextPartition(AddContextPartitionOperationContext opContext) throws Exception
PartitionNexus
addContextPartition
in interface PartitionNexus
opContext
- The Add Partition contextException
- If the addition can't be donepublic void removeContextPartition(RemoveContextPartitionOperationContext removeContextPartition) throws Exception
PartitionNexus
removeContextPartition
in interface PartitionNexus
Exception
- If the removal can't be donepublic Partition getSystemPartition()
getSystemPartition
in interface PartitionNexus
public Partition getPartition(org.apache.directory.shared.ldap.name.DN dn) throws Exception
PartitionNexus
getPartition
in interface PartitionNexus
dn
- the normalized distinguished name to get a partition forException
- if there is no partition for the dnpublic org.apache.directory.shared.ldap.name.DN getMatchedName(GetMatchedNameOperationContext matchedNameContext) throws Exception
PartitionNexus
getMatchedName
in interface PartitionNexus
Exception
- if there are any problemspublic org.apache.directory.shared.ldap.name.DN getSuffix(GetSuffixOperationContext getSuffixContext) throws Exception
PartitionNexus
getSuffix
in interface PartitionNexus
Exception
- if there are any problemspublic Set<String> listSuffixes(ListSuffixOperationContext emptyContext) throws Exception
PartitionNexus
DefaultPartitionNexus
.listSuffixes
in interface PartitionNexus
Exception
- if there are any problemspublic void registerSupportedExtensions(Set<String> extensionOids) throws Exception
PartitionNexus
registerSupportedExtensions
in interface PartitionNexus
extensionOids
- a set of OID strings to add to the supportedExtension
attribute in the RootDSEException
public void registerSupportedSaslMechanisms(Set<String> supportedSaslMechanisms) throws Exception
PartitionNexus
registerSupportedSaslMechanisms
in interface PartitionNexus
Exception
public DirectoryService getDirectoryService()
public void setDirectoryService(DirectoryService directoryService)
directoryService
- the directoryService to setCopyright © 2003–2013 The Apache Software Foundation. All rights reserved.