org.apache.directory.server.core.partition
Interface Partition

All Known Subinterfaces:
PartitionNexus
All Known Implementing Classes:
AbstractPartition, AbstractXdbmPartition, AvlPartition, BTreePartition, DefaultPartitionNexus, JdbmPartition, LdifPartition, NullPartition, SchemaPartition

public interface Partition

Interface for entry stores containing a part of the DIB (Directory Information Base). Partitions are associated with a specific suffix, and all entries contained in the them have the same DN suffix in common.

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

Method Summary
 void add(AddOperationContext opContext)
          Adds an entry to this ContextPartition.
 void bind(BindOperationContext opContext)
          Represents a bind operation issued to authenticate a client.
 void delete(DeleteOperationContext opContext)
          Deletes a leaf entry from this ContextPartition: non-leaf entries cannot be deleted until this operation has been applied to their children.
 void destroy()
          Instructs this Partition to synchronize with it's persistent store, and destroy all held resources, in preparation for a shutdown event.
 java.lang.String getId()
          Gets the unique identifier for this partition.
 org.apache.directory.shared.ldap.schema.SchemaManager getSchemaManager()
          Gets the schema manager assigned to this Partition.
 java.lang.String getSuffix()
          Gets the user provided suffix for this Partition as a String.
 org.apache.directory.shared.ldap.name.DN getSuffixDn()
          Gets the normalized suffix as an DN for this Partition after it has been initialized.
 boolean hasEntry(EntryOperationContext opContext)
          Fast operation to check and see if a particular entry exists.
 void initialize()
          Initializes this partition.
 boolean isInitialized()
          Checks to see if this partition is initialized or not.
 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.
 ClonedServerEntry lookup(LookupOperationContext lookupContext)
          Looks up an entry by distinguished/absolute name.
 void modify(ModifyOperationContext opContext)
          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 rename(RenameOperationContext opContext)
          Modifies an entry by changing its relative name.
 EntryFilteringCursor search(SearchOperationContext opContext)
          Conducts a search against this ContextPartition.
 void setId(java.lang.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(java.lang.String suffix)
          Sets the user provided suffix for this Partition as a String.
 void sync()
          Flushes any changes made to this partition now.
 void unbind(UnbindOperationContext opContext)
          Represents an unbind operation issued by an authenticated client.
 

Method Detail

getId

java.lang.String getId()
Gets the unique identifier for this partition.

Returns:
the unique identifier for this partition

setId

void setId(java.lang.String id)
Sets the unique identifier for this partition.

Parameters:
id - the unique identifier for this partition

getSuffix

java.lang.String getSuffix()
Gets the user provided suffix for this Partition as a String.


setSuffix

void setSuffix(java.lang.String suffix)
               throws org.apache.directory.shared.ldap.exception.LdapInvalidDnException
Sets the user provided suffix for this Partition as a String.

Parameters:
suffix - the suffix String for this Partition.
Throws:
org.apache.directory.shared.ldap.exception.LdapInvalidDnException - if the suffix does not conform to LDAP DN syntax

getSchemaManager

org.apache.directory.shared.ldap.schema.SchemaManager getSchemaManager()
Gets the schema manager assigned to this Partition.

Returns:
the schema manager

setSchemaManager

void setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
Sets the schema manager assigned to this Partition.

Parameters:
registries - the manager to assign to this Partition.

initialize

void initialize()
                throws java.lang.Exception
Initializes this partition.

Throws:
java.lang.Exception - if initialization fails in any way

getSuffixDn

org.apache.directory.shared.ldap.name.DN getSuffixDn()
Gets the normalized suffix as an DN for this Partition after it has been initialized. Attempts to get this DN before initialization throw an IllegalStateException.

Returns:
the suffix for this Partition.
Throws:
java.lang.IllegalStateException - if the Partition has not been initialized

destroy

void destroy()
             throws java.lang.Exception
Instructs this Partition to synchronize with it's persistent store, and destroy all held resources, in preparation for a shutdown event.

Throws:
java.lang.Exception

isInitialized

boolean isInitialized()
Checks to see if this partition is initialized or not.

Returns:
true if the partition is initialized, false otherwise

sync

void sync()
          throws java.lang.Exception
Flushes any changes made to this partition now.

Throws:
java.lang.Exception - if buffers cannot be flushed to disk

delete

void delete(DeleteOperationContext opContext)
            throws java.lang.Exception
Deletes a leaf entry from this ContextPartition: non-leaf entries cannot be deleted until this operation has been applied to their children.

Parameters:
opContext - the context of the entry to delete from this ContextPartition.
Throws:
java.lang.Exception - if there are any problems

add

void add(AddOperationContext opContext)
         throws java.lang.Exception
Adds an entry to this ContextPartition.

Parameters:
opContext - the context used to add and entry to this ContextPartition
Throws:
java.lang.Exception - if there are any problems

modify

void modify(ModifyOperationContext opContext)
            throws java.lang.Exception
Modifies an entry by adding, removing or replacing a set of attributes.

Parameters:
opContext - 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.
Throws:
java.lang.Exception - if there are any problems
See Also:
DirContext, DirContext.ADD_ATTRIBUTE, DirContext.REMOVE_ATTRIBUTE, DirContext.REPLACE_ATTRIBUTE

list

EntryFilteringCursor list(ListOperationContext opContext)
                          throws java.lang.Exception
A specialized form of one level search used to return a minimal set of information regarding child entries under a base. Convenience method used to optimize operations rather than conducting a full search with retrieval.

Parameters:
opContext - the context containing the distinguished/absolute name for the search/listing
Returns:
a NamingEnumeration containing objects of type ServerSearchResult
Throws:
java.lang.Exception - if there are any problems

search

EntryFilteringCursor search(SearchOperationContext opContext)
                            throws java.lang.Exception
Conducts a search against this ContextPartition. Namespace specific parameters for search are contained within the environment using namespace specific keys into the hash. For example in the LDAP namespace a ContextPartition implementation may look for search Controls using a namespace specific or implementation specific key for the set of LDAP Controls.

Parameters:
opContext - The context containing the information used by the operation
Returns:
a NamingEnumeration containing objects of type
Throws:
java.lang.Exception - if there are any problems

lookup

ClonedServerEntry lookup(LookupOperationContext lookupContext)
                         throws java.lang.Exception
Looks up an entry by distinguished/absolute name. This is a simplified version of the search operation used to point read an entry used for convenience. Depending on the context parameters, we my look for a simple entry, or for a restricted set of attributes for this entry

Parameters:
lookupContext - The context containing the parameters
Returns:
an Attributes object representing the entry
Throws:
java.lang.Exception - if there are any problems

hasEntry

boolean hasEntry(EntryOperationContext opContext)
                 throws java.lang.Exception
Fast operation to check and see if a particular entry exists.

Parameters:
opContext - The context used to pass informations
Returns:
true if the entry exists, false if it does not
Throws:
java.lang.Exception - if there are any problems

rename

void rename(RenameOperationContext opContext)
            throws java.lang.Exception
Modifies an entry by changing its relative name. Optionally attributes associated with the old relative name can be removed from the entry. This makes sense only in certain namespaces like LDAP and will be ignored if it is irrelevant.

Parameters:
opContext - the modify DN context
Throws:
java.lang.Exception - if there are any problems

move

void move(MoveOperationContext opContext)
          throws java.lang.Exception
Transplants a child entry, to a position in the namespace under a new parent entry.

Parameters:
opContext - The context containing the DNs to move
Throws:
java.lang.Exception - if there are any problems

moveAndRename

void moveAndRename(MoveAndRenameOperationContext opContext)
                   throws java.lang.Exception
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. The removal of old RN attributes may not make sense in all namespaces. If the concept is undefined in a namespace this parameters is ignored. An example of a namespace where this parameter is significant is the LDAP namespace.

Parameters:
opContext - The context contain all the information about the modifyDN operation
Throws:
java.lang.Exception - if there are any problems

bind

void bind(BindOperationContext opContext)
          throws java.lang.Exception
Represents a bind operation issued to authenticate a client. Partitions need not support this operation. This operation is here to enable those interested in implementing virtual directories with ApacheDS.

Parameters:
opContext - the bind context, containing all the needed informations to bind
Throws:
java.lang.Exception - if something goes wrong

unbind

void unbind(UnbindOperationContext opContext)
            throws java.lang.Exception
Represents an unbind operation issued by an authenticated client. Partitions need not support this operation. This operation is here to enable those interested in implementing virtual directories with ApacheDS.

Parameters:
opContext - the context used to unbind
Throws:
java.lang.Exception - if something goes wrong


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.