Class DefaultObjectClassRegistry
java.lang.Object
org.apache.directory.api.ldap.model.schema.registries.DefaultSchemaObjectRegistry<ObjectClass>
org.apache.directory.api.ldap.model.schema.registries.DefaultObjectClassRegistry
- All Implemented Interfaces:
Iterable<ObjectClass>, ObjectClassRegistry, SchemaObjectRegistry<ObjectClass>
public class DefaultObjectClassRegistry
extends DefaultSchemaObjectRegistry<ObjectClass>
implements ObjectClassRegistry
An ObjectClass registry's service default implementation.
- Author:
- Apache Directory Project
-
Field Summary
Fields inherited from class DefaultSchemaObjectRegistry
byName, oidRegistry, schemaObjectType -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new default ObjectClassRegistry instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the registry from all its contentcopy()Copy a DefaultSchemaObjectRegistry.descendants(String ancestorId) Get's an iterator over the set of descendant ObjectClasses for some ancestor's name alias or their OID.booleanhasDescendants(String ancestorId) Quick lookup to see if an objectClass has descendants.voidregisterDescendants(ObjectClass objectClass, List<ObjectClass> ancestors) Store the ObjectClass into a map associating an ObjectClass to its descendants.unregister(String numericOid) Removes the SchemaObject registered with this registry, using its numeric OID.voidunregisterDescendants(ObjectClass attributeType, List<ObjectClass> ancestors) Remove the ObjectClass from the map associating an ObjectClass to its descendants.Methods inherited from class DefaultSchemaObjectRegistry
contains, copy, get, getErrorHandler, getOidByName, getSchemaName, getType, isRelaxed, isStrict, iterator, lookup, oidsIterator, register, renameSchema, setErrorHandler, setRelaxed, setStrict, size, toString, unregister, unregisterSchemaElementsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface ObjectClassRegistry
registerMethods inherited from interface SchemaObjectRegistry
contains, get, getOidByName, getSchemaName, getType, iterator, lookup, oidsIterator, renameSchema, size, unregister, unregisterSchemaElements
-
Constructor Details
-
DefaultObjectClassRegistry
public DefaultObjectClassRegistry()Creates a new default ObjectClassRegistry instance.
-
-
Method Details
-
hasDescendants
Quick lookup to see if an objectClass has descendants.- Specified by:
hasDescendantsin interfaceObjectClassRegistry- 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
Get's an iterator over the set of descendant ObjectClasses for some ancestor's name alias or their OID.- Specified by:
descendantsin interfaceObjectClassRegistry- 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, List<ObjectClass> ancestors) throws LdapException Store the ObjectClass into a map associating an ObjectClass to its descendants.- Specified by:
registerDescendantsin interfaceObjectClassRegistry- Parameters:
objectClass- The ObjectClass to registerancestors- Its ancestors- Throws:
LdapException- If something went wrong
-
unregisterDescendants
public void unregisterDescendants(ObjectClass attributeType, List<ObjectClass> ancestors) throws LdapException Remove the ObjectClass from the map associating an ObjectClass to its descendants.- Specified by:
unregisterDescendantsin interfaceObjectClassRegistry- Parameters:
attributeType- The ObjectClass to unregisterancestors- its ancestors- Throws:
LdapException- If something went wrong
-
unregister
Removes the SchemaObject registered with this registry, using its numeric OID.- Specified by:
unregisterin interfaceObjectClassRegistry- Specified by:
unregisterin interfaceSchemaObjectRegistry<ObjectClass>- Overrides:
unregisterin classDefaultSchemaObjectRegistry<ObjectClass>- Parameters:
numericOid- the numeric identifier- Returns:
- The unregistred schema object
- Throws:
LdapException- if the numeric identifier is invalid
-
copy
Copy a DefaultSchemaObjectRegistry. All the stored SchemaObject will also be copied, by the cross references will be lost.- Specified by:
copyin interfaceObjectClassRegistry- Specified by:
copyin interfaceSchemaObjectRegistry<ObjectClass>- Returns:
- The copied registry
-
clear
public void clear()Clear the registry from all its content- Specified by:
clearin interfaceSchemaObjectRegistry<ObjectClass>- Overrides:
clearin classDefaultSchemaObjectRegistry<ObjectClass>
-