com.ca.jcs.standalone
Class CustomJdbmPartition

java.lang.Object
  extended by org.apache.directory.server.core.partition.impl.btree.BTreePartition
      extended by org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition
          extended by com.ca.jcs.standalone.CustomJdbmPartition
All Implemented Interfaces:
Partition

public class CustomJdbmPartition
extends JdbmPartition

A custom implementation of JdbmPartition that adds support for:

Note: The reason OID conversion is performed is that JdbmPartition requires DNs in the non-human friendly OID (Object IDentifier) based representation. The same functionality can also be achieved by proxying a partition in InverseReplaceOIDsProxyHandler.

Author:
fittr01

Field Summary
protected  Set<CustomJdbmPartitionObserver> observers
          Set of observers for partition changes
 
Fields inherited from class org.apache.directory.server.core.partition.impl.btree.BTreePartition
btpConfig, oidRegistry
 
Fields inherited from interface org.apache.directory.server.core.partition.Partition
ALIAS_ATTRIBUTE, ALIAS_OBJECT
 
Constructor Summary
CustomJdbmPartition(AttributeTypeRegistry attributeTypeRegistry)
          Constructor.
 
Method Summary
 void add(LdapDN dn, Attributes entry)
           
 void addObserver(CustomJdbmPartitionObserver observer)
          Add an observer to get notified of partition changes.
protected  void checkValidDn(LdapDN dn)
          Method to check that a DN being modified is not restricted.
protected  LdapDN convertToFriendly(LdapDN ldapDN)
          Method to convert all OIDs in a DN to friendly names.
protected  LdapDN convertToOids(LdapDN ldapDN)
          Method to convert all friendly names in a DN to OIDs.
 void delete(LdapDN dn)
           
 LdapDN getRestrictDn()
           
 Attributes lookup(LdapDN dn)
           
 Attributes lookup(LdapDN dn, String[] attrIds)
           
 void modify(LdapDN dn, int modOp, Attributes mods)
           
 void modify(LdapDN dn, ModificationItem[] mods)
           
 void modifyRn(LdapDN dn, String newRdn, boolean deleteOldRdn)
           
 void move(LdapDN oldChildDn, LdapDN newParentDn)
           
 void move(LdapDN oldChildDn, LdapDN newParentDn, String newRdn, boolean deleteOldRdn)
           
 NamingEnumeration search(LdapDN base, Map env, ExprNode filter, SearchControls searchCtls)
           
 void setRestrictDn(LdapDN restrictDn)
           
 
Methods inherited from class org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition
addIndexOn, bind, count, delete, destroy, getAliasIndex, getChildCount, getEntryDn, getEntryId, getEntryUpdn, getEntryUpdn, getExistanceIndex, getHierarchyIndex, getIndices, getNdnIndex, getOneAliasIndex, getParentId, getParentId, getProperty, getSubAliasIndex, getSuffix, getSuffixEntry, getSystemIndex, getSystemIndices, getUpdnIndex, getUpSuffix, getUserIndex, getUserIndices, hasSystemIndexOn, hasUserIndexOn, init, isInitialized, list, lookup, setAliasIndexOn, setExistanceIndexOn, setHierarchyIndexOn, setNdnIndexOn, setOneAliasIndexOn, setProperty, setSubAliasIndexOn, setUpdnIndexOn, sync, unbind
 
Methods inherited from class org.apache.directory.server.core.partition.impl.btree.BTreePartition
getSearchEngine, hasEntry, inspect, isSuffix, list, setRegistries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

observers

protected Set<CustomJdbmPartitionObserver> observers
Set of observers for partition changes

Constructor Detail

CustomJdbmPartition

public CustomJdbmPartition(AttributeTypeRegistry attributeTypeRegistry)
Constructor.

Parameters:
attributeTypeRegistry - Attribute type registry used for OID conversions
Method Detail

checkValidDn

protected void checkValidDn(LdapDN dn)
                     throws NamingException
Method to check that a DN being modified is not restricted.

Parameters:
dn - the DN to check.
Throws:
NamingException

convertToOids

protected LdapDN convertToOids(LdapDN ldapDN)
                        throws NamingException
Method to convert all friendly names in a DN to OIDs.

Parameters:
ldapDN - the DN to convert
Returns:
the converted DN
Throws:
NamingException

convertToFriendly

protected LdapDN convertToFriendly(LdapDN ldapDN)
                            throws NamingException
Method to convert all OIDs in a DN to friendly names.

Parameters:
ldapDN - the DN to convert
Returns:
the converted DN
Throws:
NamingException

search

public NamingEnumeration search(LdapDN base,
                                Map env,
                                ExprNode filter,
                                SearchControls searchCtls)
                         throws NamingException
Specified by:
search in interface Partition
Overrides:
search in class BTreePartition
Throws:
NamingException

lookup

public Attributes lookup(LdapDN dn,
                         String[] attrIds)
                  throws NamingException
Specified by:
lookup in interface Partition
Overrides:
lookup in class BTreePartition
Throws:
NamingException

lookup

public Attributes lookup(LdapDN dn)
                  throws NamingException
Specified by:
lookup in interface Partition
Overrides:
lookup in class BTreePartition
Throws:
NamingException

add

public void add(LdapDN dn,
                Attributes entry)
         throws NamingException
Specified by:
add in interface Partition
Overrides:
add in class JdbmPartition
Throws:
NamingException

modify

public void modify(LdapDN dn,
                   int modOp,
                   Attributes mods)
            throws NamingException
Specified by:
modify in interface Partition
Overrides:
modify in class JdbmPartition
Throws:
NamingException

modify

public void modify(LdapDN dn,
                   ModificationItem[] mods)
            throws NamingException
Specified by:
modify in interface Partition
Overrides:
modify in class JdbmPartition
Throws:
NamingException

modifyRn

public void modifyRn(LdapDN dn,
                     String newRdn,
                     boolean deleteOldRdn)
              throws NamingException
Specified by:
modifyRn in interface Partition
Overrides:
modifyRn in class JdbmPartition
Throws:
NamingException

delete

public void delete(LdapDN dn)
            throws NamingException
Specified by:
delete in interface Partition
Overrides:
delete in class BTreePartition
Throws:
NamingException

move

public void move(LdapDN oldChildDn,
                 LdapDN newParentDn,
                 String newRdn,
                 boolean deleteOldRdn)
          throws NamingException
Specified by:
move in interface Partition
Overrides:
move in class JdbmPartition
Throws:
NamingException

move

public void move(LdapDN oldChildDn,
                 LdapDN newParentDn)
          throws NamingException
Specified by:
move in interface Partition
Overrides:
move in class JdbmPartition
Throws:
NamingException

getRestrictDn

public LdapDN getRestrictDn()
Returns:
the restrictDn

setRestrictDn

public void setRestrictDn(LdapDN restrictDn)
                   throws NamingException
Parameters:
restrictDn - the restrictDn to set
Throws:
NamingException

addObserver

public void addObserver(CustomJdbmPartitionObserver observer)
Add an observer to get notified of partition changes.

Parameters:
observer - the observer instance.


Created 2011-07-14 13:27 EST