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: 434579 $
Author:
Apache Directory Project

Field Summary
static java.lang.String ALIAS_ATTRIBUTE
          The aliased Dn attribute name: aliasedObjectName for LDAP and aliasedEntryName or X.500.
static java.lang.String ALIAS_OBJECT
          The objectClass name for aliases: 'alias'
 
Method Summary
 void add(LdapDN name, javax.naming.directory.Attributes entry)
          Adds an entry to this ContextPartition.
 void bind(LdapDN bindDn, byte[] credentials, java.util.List mechanisms, java.lang.String saslAuthId)
          Represents a bind operation issued to authenticate a client.
 void delete(LdapDN name)
          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.
 LdapDN getSuffix()
          Gets the distinguished/absolute name of the suffix for all entries stored within this ContextPartition.
 LdapDN getUpSuffix()
          Gets the distinguished/absolute name of the suffix for all entries stored within this ContextPartition.
 boolean hasEntry(LdapDN name)
          Fast operation to check and see if a particular entry exists.
 void init(DirectoryServiceConfiguration factoryCfg, PartitionConfiguration cfg)
          Initializes this partition.
 boolean isInitialized()
          Checks to see if this partition is initialized or not.
 boolean isSuffix(LdapDN name)
          Checks to see if name is a context suffix.
 javax.naming.NamingEnumeration list(LdapDN baseName)
          A specialized form of one level search used to return a minimal set of information regarding child entries under a base.
 javax.naming.directory.Attributes lookup(LdapDN name)
          Looks up an entry by distinguished/absolute name.
 javax.naming.directory.Attributes lookup(LdapDN name, java.lang.String[] attrIds)
          Looks up an entry by distinguished/absolute name.
 void modify(LdapDN name, int modOp, javax.naming.directory.Attributes attributes)
          Modifies an entry by adding, removing or replacing a set of attributes.
 void modify(LdapDN name, javax.naming.directory.ModificationItem[] items)
          Modifies an entry by using a combination of adds, removes or replace operations using a set of ModificationItems.
 void modifyRn(LdapDN name, java.lang.String newRn, boolean deleteOldRn)
          Modifies an entry by changing its relative name.
 void move(LdapDN oldName, LdapDN newParentName)
          Transplants a child entry, to a position in the namespace under a new parent entry.
 void move(LdapDN oldName, LdapDN newParentName, java.lang.String newRn, boolean deleteOldRn)
          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.
 javax.naming.NamingEnumeration search(LdapDN baseName, java.util.Map environment, ExprNode filter, javax.naming.directory.SearchControls searchControls)
          Conducts a search against this ContextPartition.
 void sync()
          Flushes any changes made to this partition now.
 void unbind(LdapDN bindDn)
          Represents an unbind operation issued by an authenticated client.
 

Field Detail

ALIAS_OBJECT

static final java.lang.String ALIAS_OBJECT
The objectClass name for aliases: 'alias'

See Also:
Constant Field Values

ALIAS_ATTRIBUTE

static final java.lang.String ALIAS_ATTRIBUTE
The aliased Dn attribute name: aliasedObjectName for LDAP and aliasedEntryName or X.500.

See Also:
Constant Field Values
Method Detail

init

void init(DirectoryServiceConfiguration factoryCfg,
          PartitionConfiguration cfg)
          throws javax.naming.NamingException
Initializes this partition.

Throws:
javax.naming.NamingException

destroy

void destroy()
Deinitialized this partition.


isInitialized

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


sync

void sync()
          throws javax.naming.NamingException
Flushes any changes made to this partition now.

Throws:
javax.naming.NamingException

getSuffix

LdapDN getSuffix()
                 throws javax.naming.NamingException
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:
javax.naming.NamingException

getUpSuffix

LdapDN getUpSuffix()
                   throws javax.naming.NamingException
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:
javax.naming.NamingException

delete

void delete(LdapDN name)
            throws javax.naming.NamingException
Deletes a leaf entry from this ContextPartition: non-leaf entries cannot be deleted until this operation has been applied to their children.

Parameters:
name - the normalized distinguished/absolute name of the entry to delete from this ContextPartition.
Throws:
javax.naming.NamingException - if there are any problems

add

void add(LdapDN name,
         javax.naming.directory.Attributes entry)
         throws javax.naming.NamingException
Adds an entry to this ContextPartition.

Parameters:
name -
entry - the entry to add to this ContextPartition
Throws:
javax.naming.NamingException - if there are any problems

modify

void modify(LdapDN name,
            int modOp,
            javax.naming.directory.Attributes attributes)
            throws javax.naming.NamingException
Modifies an entry by adding, removing or replacing a set of attributes.

Parameters:
name - the normalized distinguished/absolute name of the entry to modify
modOp - the modification operation to perform on the entry which is one of constants specified by the DirContext interface: ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE.
attributes - the attributes and their values used to affect the modification with.
Throws:
javax.naming.NamingException - if there are any problems
See Also:
DirContext, DirContext.ADD_ATTRIBUTE, DirContext.REMOVE_ATTRIBUTE, DirContext.REPLACE_ATTRIBUTE

modify

void modify(LdapDN name,
            javax.naming.directory.ModificationItem[] items)
            throws javax.naming.NamingException
Modifies an entry by using a combination of adds, removes or replace operations using a set of ModificationItems.

Parameters:
name - the normalized distinguished/absolute name of the entry to modify
items - the ModificationItems used to affect the modification with
Throws:
javax.naming.NamingException - if there are any problems
See Also:
ModificationItem

list

javax.naming.NamingEnumeration list(LdapDN baseName)
                                    throws javax.naming.NamingException
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:
baseName - the base distinguished/absolute name for the search/listing
Returns:
a NamingEnumeration containing objects of type SearchResult
Throws:
javax.naming.NamingException - if there are any problems

search

javax.naming.NamingEnumeration search(LdapDN baseName,
                                      java.util.Map environment,
                                      ExprNode filter,
                                      javax.naming.directory.SearchControls searchControls)
                                      throws javax.naming.NamingException
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:
baseName - the normalized distinguished/absolute name of the search base
environment - the environment under which operation occurs
filter - the root node of the filter expression tree
searchControls - the search controls
Returns:
a NamingEnumeration containing objects of type SearchResult.
Throws:
javax.naming.NamingException - if there are any problems

lookup

javax.naming.directory.Attributes lookup(LdapDN name)
                                         throws javax.naming.NamingException
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.

Parameters:
name - the normalized distinguished name of the object to lookup
Returns:
an Attributes object representing the entry
Throws:
javax.naming.NamingException - if there are any problems

lookup

javax.naming.directory.Attributes lookup(LdapDN name,
                                         java.lang.String[] attrIds)
                                         throws javax.naming.NamingException
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 with a set of attributes to return. If the attributes is null or empty, the returned entry will contain all attributes.

Parameters:
name - the normalized distinguished name of the object to lookup
attrIds - the set of attributes to return
Returns:
an Attributes object representing the entry
Throws:
javax.naming.NamingException - if there are any problems

hasEntry

boolean hasEntry(LdapDN name)
                 throws javax.naming.NamingException
Fast operation to check and see if a particular entry exists.

Parameters:
name - the normalized distinguished/absolute name of the object to check for existance
Returns:
true if the entry exists, false if it does not
Throws:
javax.naming.NamingException - if there are any problems

isSuffix

boolean isSuffix(LdapDN name)
                 throws javax.naming.NamingException
Checks to see if name is a context suffix.

Parameters:
name - the normalized distinguished/absolute name of the context
Returns:
true if the name is a context suffix, false if it is not.
Throws:
javax.naming.NamingException - if there are any problems

modifyRn

void modifyRn(LdapDN name,
              java.lang.String newRn,
              boolean deleteOldRn)
              throws javax.naming.NamingException
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:
name - the normalized distinguished/absolute name of the entry to modify the RN of.
newRn - the new RN of the entry specified by name
deleteOldRn - boolean flag which removes the old RN attribute from the entry if set to true, and has no affect if set to false
Throws:
javax.naming.NamingException - if there are any problems

move

void move(LdapDN oldName,
          LdapDN newParentName)
          throws javax.naming.NamingException
Transplants a child entry, to a position in the namespace under a new parent entry.

Parameters:
oldName - the normalized distinguished/absolute name of the original child name representing the child entry to move
newParentName - the normalized distinguished/absolute name of the new parent to move the target entry to
Throws:
javax.naming.NamingException - if there are any problems

move

void move(LdapDN oldName,
          LdapDN newParentName,
          java.lang.String newRn,
          boolean deleteOldRn)
          throws javax.naming.NamingException
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:
oldName - the normalized distinguished/absolute name of the original child name representing the child entry to move
newParentName - the normalized distinguished/absolute name of the new parent to move the targeted entry to
newRn - the new RN of the entry
deleteOldRn - boolean flag which removes the old RN attribute from the entry if set to true, and has no affect if set to false
Throws:
javax.naming.NamingException - if there are any problems

bind

void bind(LdapDN bindDn,
          byte[] credentials,
          java.util.List mechanisms,
          java.lang.String saslAuthId)
          throws javax.naming.NamingException
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:
bindDn - the normalized dn of the principal
credentials - the credentials of the principal
mechanisms - the mechanisms requested by the JNDI caller or a single mechanism representing the SASL bind mechanism used by a networked client (Strings)
saslAuthId - the SASL authentication (may be null)
Throws:
javax.naming.NamingException - if something goes wrong

unbind

void unbind(LdapDN bindDn)
            throws javax.naming.NamingException
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:
bindDn - the normalized dn of the principal attempting to unbind
Throws:
javax.naming.NamingException - if something goes wrong