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 org.apache.directory.api.ldap.model.schema.registries.DefaultSchemaObjectRegistry
byName, oidRegistry, schemaObjectType
-
-
Constructor Summary
Constructors Constructor Description DefaultObjectClassRegistry()Creates a new default ObjectClassRegistry instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the registry from all its contentDefaultObjectClassRegistrycopy()Copy the ObjectClassRegistryIterator<ObjectClass>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.ObjectClassunregister(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 org.apache.directory.api.ldap.model.schema.registries.DefaultSchemaObjectRegistry
contains, copy, get, getErrorHandler, getOidByName, getSchemaName, getType, isRelaxed, isStrict, iterator, lookup, oidsIterator, register, renameSchema, setErrorHandler, setRelaxed, setStrict, 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 java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.apache.directory.api.ldap.model.schema.registries.ObjectClassRegistry
register
-
Methods inherited from interface org.apache.directory.api.ldap.model.schema.registries.SchemaObjectRegistry
contains, get, getOidByName, getSchemaName, getType, iterator, lookup, oidsIterator, renameSchema, size, unregister, unregisterSchemaElements
-
-
-
-
Method Detail
-
hasDescendants
public boolean hasDescendants(String ancestorId) throws LdapException
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
public Iterator<ObjectClass> descendants(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:
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
public ObjectClass unregister(String numericOid) throws LdapException
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
public DefaultObjectClassRegistry copy()
Copy the ObjectClassRegistry- 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>
-
-