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
-
-
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 void
clear()
Clear the registry from all its contentDefaultObjectClassRegistry
copy()
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.boolean
hasDescendants(String ancestorId)
Quick lookup to see if an objectClass has descendants.void
registerDescendants(ObjectClass objectClass, List<ObjectClass> ancestors)
Store the ObjectClass into a map associating an ObjectClass to its descendants.ObjectClass
unregister(String numericOid)
Removes the SchemaObject registered with this registry, using its numeric OID.void
unregisterDescendants(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
equals, 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
-
-
-
-
Constructor Detail
-
DefaultObjectClassRegistry
public DefaultObjectClassRegistry()
Creates a new default ObjectClassRegistry instance.
-
-
Method Detail
-
hasDescendants
public boolean hasDescendants(String ancestorId) throws LdapException
Quick lookup to see if an objectClass has descendants.- Specified by:
hasDescendants
in 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:
descendants
in 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:
registerDescendants
in 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:
unregisterDescendants
in 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:
unregister
in interfaceObjectClassRegistry
- Specified by:
unregister
in interfaceSchemaObjectRegistry<ObjectClass>
- Overrides:
unregister
in 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:
copy
in interfaceObjectClassRegistry
- Specified by:
copy
in interfaceSchemaObjectRegistry<ObjectClass>
- Returns:
- The copied registry
-
clear
public void clear()
Clear the registry from all its content- Specified by:
clear
in interfaceSchemaObjectRegistry<ObjectClass>
- Overrides:
clear
in classDefaultSchemaObjectRegistry<ObjectClass>
-
-