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

All Known Implementing Classes:
AbstractPartition, BTreePartition, DefaultPartitionNexus, JdbmPartition, PartitionNexus, PartitionNexusProxy

public interface Partition

An interfaces that bridges between underlying JNDI entries and JNDI Context API. DIT (Directory Information Tree) consists one or above Partitions whose parent is PartitionNexus, and all of them are mapped to different base suffix. Each partition contains entries whose name ends with that base suffix.

Version:
$Rev: 689396 $
Author:
Apache Directory Project
'XBean'

Field Summary
static int DEFAULT_CACHE_SIZE
          the default entry cache size to use for a partition
static java.lang.String DEFAULT_PARTITION_IMPLEMENTATION
          default partition implementation class
static java.lang.String SYSTEM_PARTITION_NAME
          The name of reserved system partition
 
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()
          Deinitialized this partition.
 int getCacheSize()
          Gets the entry cache size for this partition.
 java.lang.String getId()
          Gets the unique identifier for this partition.
 java.lang.String getSuffix()
          Gets the non-normalized suffix for this Partition as a string.
 org.apache.directory.shared.ldap.name.LdapDN getSuffixDn()
          Gets the distinguished/absolute name of the suffix for all entries stored within this ContextPartition.
 org.apache.directory.shared.ldap.name.LdapDN getUpSuffixDn()
          Gets the distinguished/absolute name of the suffix for all entries stored within this ContextPartition.
 boolean hasEntry(EntryOperationContext opContext)
          Fast operation to check and see if a particular entry exists.
 void init(DirectoryService core)
          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(java.lang.Long id)
           
 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 setCacheSize(int cacheSize)
          Used to specify the entry cache size for a Partition.
 void setId(java.lang.String id)
          Sets the unique identifier for this partition.
 void setSuffix(java.lang.String suffix)
          Sets the non-normalized 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.
 

Field Detail

SYSTEM_PARTITION_NAME

static final java.lang.String SYSTEM_PARTITION_NAME
The name of reserved system partition

See Also:
Constant Field Values

DEFAULT_PARTITION_IMPLEMENTATION

static final java.lang.String DEFAULT_PARTITION_IMPLEMENTATION
default partition implementation class

See Also:
Constant Field Values

DEFAULT_CACHE_SIZE

static final int DEFAULT_CACHE_SIZE
the default entry cache size to use for a partition

See Also:
Constant Field Values
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 non-normalized suffix for this Partition as a string.

Returns:
the suffix string for this Partition.

setSuffix

void setSuffix(java.lang.String suffix)
Sets the non-normalized suffix for this Partition as a string.

Parameters:
suffix - the suffix string for this Partition.

setCacheSize

void setCacheSize(int cacheSize)
Used to specify the entry cache size for a Partition. Various Partition implementations may interpret this value in different ways: i.e. total cache size limit verses the number of entries to cache.

Parameters:
cacheSize - the size of the cache

getCacheSize

int getCacheSize()
Gets the entry cache size for this partition.

Returns:
the size of the cache

init

void init(DirectoryService core)
          throws java.lang.Exception
Initializes this partition.

Parameters:
core - the directory core for the server.
Throws:
java.lang.Exception - if initialization fails in any way

destroy

void destroy()
             throws java.lang.Exception
Deinitialized this partition.

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

getSuffixDn

org.apache.directory.shared.ldap.name.LdapDN getSuffixDn()
                                                         throws java.lang.Exception
Gets the distinguished/absolute name of the suffix for all entries stored within this ContextPartition.

Returns:
Name representing the distinguished/absolute name of this ContextPartitions root context.
Throws:
java.lang.Exception - if access or suffix parsing fails

getUpSuffixDn

org.apache.directory.shared.ldap.name.LdapDN getUpSuffixDn()
                                                           throws java.lang.Exception
Gets the distinguished/absolute name of the suffix for all entries stored within this ContextPartition.

Returns:
Name representing the distinguished/absolute name of this ContextPartitions root context.
Throws:
java.lang.Exception - if access or suffix parsing fails

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 contetx containin 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

lookup

ClonedServerEntry lookup(java.lang.Long id)
                         throws java.lang.Exception
Throws:
java.lang.Exception

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 irrelavent.

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-2009 Apache Software Foundation. All Rights Reserved.