org.apache.directory.shared.ldap.schema.registries
Class DefaultObjectClassRegistry

java.lang.Object
  extended by org.apache.directory.shared.ldap.schema.registries.DefaultSchemaObjectRegistry<ObjectClass>
      extended by org.apache.directory.shared.ldap.schema.registries.DefaultObjectClassRegistry
All Implemented Interfaces:
java.lang.Iterable<ObjectClass>, ObjectClassRegistry, SchemaObjectRegistry<ObjectClass>

public class DefaultObjectClassRegistry
extends DefaultSchemaObjectRegistry<ObjectClass>
implements ObjectClassRegistry

An ObjectClass registry's service default implementation.

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

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.schema.registries.DefaultSchemaObjectRegistry
byName, oidRegistry, schemaObjectType
 
Constructor Summary
DefaultObjectClassRegistry()
          Creates a new default ObjectClassRegistry instance.
 
Method Summary
 void clear()
          Clear the registry from all its content
 DefaultObjectClassRegistry copy()
          Copy the ObjectClassRegistry
 java.util.Iterator<ObjectClass> descendants(java.lang.String ancestorId)
          Get's an iterator over the set of descendant ObjectClasses for some ancestor's name alias or their OID.
 boolean hasDescendants(java.lang.String ancestorId)
          Quick lookup to see if an objectClass has descendants.
 void registerDescendants(ObjectClass objectClass, java.util.List<ObjectClass> ancestors)
          Store the ObjectClass into a map associating an ObjectClass to its descendants.
 ObjectClass unregister(java.lang.String numericOid)
          Removes the SchemaObject registered with this registry, using its numeric OID.
 void unregisterDescendants(ObjectClass attributeType, java.util.List<ObjectClass> ancestors)
          Remove the ObjectClass from the map associating an ObjectClass to its descendants.
 
Methods inherited from class org.apache.directory.shared.ldap.schema.registries.DefaultSchemaObjectRegistry
contains, copy, get, getOidByName, getSchemaName, getType, iterator, lookup, oidsIterator, register, renameSchema, size, toString, unregister, unregisterSchemaElements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry
register
 
Methods inherited from interface org.apache.directory.shared.ldap.schema.registries.SchemaObjectRegistry
contains, get, getOidByName, getSchemaName, getType, iterator, lookup, oidsIterator, renameSchema, size, unregister, unregisterSchemaElements
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

DefaultObjectClassRegistry

public DefaultObjectClassRegistry()
Creates a new default ObjectClassRegistry instance.

Method Detail

hasDescendants

public boolean hasDescendants(java.lang.String ancestorId)
                       throws LdapException
Quick lookup to see if an objectClass has descendants.

Specified by:
hasDescendants in interface ObjectClassRegistry
Parameters:
ancestorId - the name alias or OID for an ObjectClass
Returns:
an Iterator over the ObjectClasses which have the ancestor within their superior chain to the top
Throws:
LdapException - if the ancestor ObjectClass cannot be discerned from the ancestorId supplied

descendants

public java.util.Iterator<ObjectClass> descendants(java.lang.String ancestorId)
                                            throws LdapException
Get's an iterator over the set of descendant ObjectClasses for some ancestor's name alias or their OID.

Specified by:
descendants in interface ObjectClassRegistry
Parameters:
ancestorId - the name alias or OID for an ObjectClass
Returns:
an Iterator over the ObjectClasses which have the ancestor within their superior chain to the top
Throws:
LdapException - if the ancestor ObjectClass cannot be discerned from the ancestorId supplied

registerDescendants

public void registerDescendants(ObjectClass objectClass,
                                java.util.List<ObjectClass> ancestors)
                         throws LdapException
Store the ObjectClass into a map associating an ObjectClass to its descendants.

Specified by:
registerDescendants in interface ObjectClassRegistry
Throws:
LdapException - If something went wrong

unregisterDescendants

public void unregisterDescendants(ObjectClass attributeType,
                                  java.util.List<ObjectClass> ancestors)
                           throws LdapException
Remove the ObjectClass from the map associating an ObjectClass to its descendants.

Specified by:
unregisterDescendants in interface ObjectClassRegistry
Parameters:
attributeType - The ObjectClass to unregister
Throws:
LdapException - If something went wrong

unregister

public ObjectClass unregister(java.lang.String numericOid)
                       throws LdapException
Removes the SchemaObject registered with this registry, using its numeric OID.

Specified by:
unregister in interface ObjectClassRegistry
Specified by:
unregister in interface SchemaObjectRegistry<ObjectClass>
Overrides:
unregister in class DefaultSchemaObjectRegistry<ObjectClass>
Parameters:
numericOid - the numeric identifier
Throws:
LdapException - if the numeric identifier is invalid

copy

public DefaultObjectClassRegistry copy()
Copy the ObjectClassRegistry

Specified by:
copy in interface ObjectClassRegistry
Specified by:
copy in interface SchemaObjectRegistry<ObjectClass>
Returns:
SchemaObjectRegistry The copied registry

clear

public void clear()
Clear the registry from all its content

Specified by:
clear in interface SchemaObjectRegistry<ObjectClass>
Overrides:
clear in class DefaultSchemaObjectRegistry<ObjectClass>


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