org.apache.directory.server.core.partition
Class NullPartition

java.lang.Object
  extended by org.apache.directory.server.core.partition.AbstractPartition
      extended by org.apache.directory.server.core.partition.NullPartition
All Implemented Interfaces:
Partition

public class NullPartition
extends AbstractPartition

A dummy do nothing partition that is useful for testing NullPartition.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.server.core.partition.AbstractPartition
initialized
 
Constructor Summary
NullPartition()
          Creates a new instance of NullPartition.
 
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.
protected  void doDestroy()
          Override this method to put your initialization code.
protected  void doInit()
          Override this method to put your initialization code.
 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.
 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)
          This method calls Partition.lookup(LookupOperationContext) with null attributeIds by default.
 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()
          This method does nothing by default.
 void unbind(UnbindOperationContext opContext)
          Represents an unbind operation issued by an authenticated client.
 
Methods inherited from class org.apache.directory.server.core.partition.AbstractPartition
destroy, hasEntry, initialize, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullPartition

public NullPartition()
Creates a new instance of NullPartition.

Method Detail

add

public void add(AddOperationContext opContext)
         throws java.lang.Exception
Description copied from interface: Partition
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

bind

public void bind(BindOperationContext opContext)
          throws java.lang.Exception
Description copied from interface: Partition
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

delete

public void delete(DeleteOperationContext opContext)
            throws java.lang.Exception
Description copied from interface: Partition
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

getId

public java.lang.String getId()
Description copied from interface: Partition
Gets the unique identifier for this partition.

Returns:
the unique identifier for this partition

getSuffixDn

public org.apache.directory.shared.ldap.name.DN getSuffixDn()
Description copied from interface: Partition
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.

list

public EntryFilteringCursor list(ListOperationContext opContext)
                          throws java.lang.Exception
Description copied from interface: Partition
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

lookup

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

modify

public void modify(ModifyOperationContext opContext)
            throws java.lang.Exception
Description copied from interface: Partition
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

move

public void move(MoveOperationContext opContext)
          throws java.lang.Exception
Description copied from interface: Partition
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

public void moveAndRename(MoveAndRenameOperationContext opContext)
                   throws java.lang.Exception
Description copied from interface: Partition
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

rename

public void rename(RenameOperationContext opContext)
            throws java.lang.Exception
Description copied from interface: Partition
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

search

public EntryFilteringCursor search(SearchOperationContext opContext)
                            throws java.lang.Exception
Description copied from interface: Partition
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

setId

public void setId(java.lang.String id)
Description copied from interface: Partition
Sets the unique identifier for this partition.

Parameters:
id - the unique identifier for this partition

setSuffix

public 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

unbind

public void unbind(UnbindOperationContext opContext)
            throws java.lang.Exception
Description copied from interface: Partition
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

getSuffix

public java.lang.String getSuffix()
Description copied from interface: Partition
Gets the user provided suffix for this Partition as a String.


getSchemaManager

public org.apache.directory.shared.ldap.schema.SchemaManager getSchemaManager()
Description copied from interface: Partition
Gets the schema manager assigned to this Partition.

Returns:
the schema manager

setSchemaManager

public void setSchemaManager(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
Description copied from interface: Partition
Sets the schema manager assigned to this Partition.


doDestroy

protected void doDestroy()
                  throws java.lang.Exception
Description copied from class: AbstractPartition
Override this method to put your initialization code.

Specified by:
doDestroy in class AbstractPartition
Throws:
java.lang.Exception

doInit

protected void doInit()
               throws javax.naming.InvalidNameException,
                      java.lang.Exception
Description copied from class: AbstractPartition
Override this method to put your initialization code.

Specified by:
doInit in class AbstractPartition
Throws:
java.lang.Exception
javax.naming.InvalidNameException

lookup

public ClonedServerEntry lookup(LookupOperationContext lookupContext)
                         throws java.lang.Exception
Description copied from class: AbstractPartition
This method calls Partition.lookup(LookupOperationContext) with null attributeIds by default. Please override this method if there is more effective way for your implementation.

Specified by:
lookup in interface Partition
Specified by:
lookup in class AbstractPartition
Parameters:
lookupContext - The context containing the parameters
Returns:
an Attributes object representing the entry
Throws:
java.lang.Exception - if there are any problems

sync

public void sync()
          throws java.lang.Exception
Description copied from class: AbstractPartition
This method does nothing by default.

Specified by:
sync in interface Partition
Specified by:
sync in class AbstractPartition
Throws:
java.lang.Exception - if buffers cannot be flushed to disk


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