Class DefaultAttributeTypeRegistry
java.lang.Object
org.apache.directory.api.ldap.model.schema.registries.DefaultSchemaObjectRegistry<AttributeType>
org.apache.directory.api.ldap.model.schema.registries.DefaultAttributeTypeRegistry
- All Implemented Interfaces:
Iterable<AttributeType>, AttributeTypeRegistry, SchemaObjectRegistry<AttributeType>
public class DefaultAttributeTypeRegistry
extends DefaultSchemaObjectRegistry<AttributeType>
implements AttributeTypeRegistry
An AttributeType registry service default implementation.
- Author:
- Apache Directory Project
-
Field Summary
Fields inherited from class DefaultSchemaObjectRegistry
byName, oidRegistry, schemaObjectType -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new default AttributeTypeRegistry instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMappingFor(AttributeType attributeType) Add a new Oid/Normalizer couple in the OidNormalizer mapvoidclear()Clear the registry from all its contentcopy()Copy a DefaultSchemaObjectRegistry.descendants(String ancestorId) Get's an iterator over the set of descendant attributeTypes for some ancestor's name alias or their OID.descendants(AttributeType ancestor) Get's an iterator over the set of descendant attributeTypes for some ancestor's name alias or their OID.Gets an oid/name to normalizer mapping used to normalize distinguished names.booleanhasDescendants(String ancestorId) Quick lookup to see if an attribute has descendants.booleanhasDescendants(AttributeType ancestor) Quick lookup to see if an attribute has descendants.Looks up a SchemaObject by its unique Object Identifier or by name.voidregisterDescendants(AttributeType attributeType, AttributeType ancestor) Store the AttributeType into a map associating an AttributeType to its descendants.voidremoveMappingFor(AttributeType attributeType) Remove the AttributeType normalizer from the OidNormalizer mapunregister(String numericOid) Removes the SchemaObject registered with this registry, using its numeric OID.voidunregisterDescendants(AttributeType attributeType, AttributeType ancestor) Remove the AttributeType from the map associating an AttributeType to its descendants.Methods inherited from class DefaultSchemaObjectRegistry
contains, copy, get, getErrorHandler, getOidByName, getSchemaName, getType, isRelaxed, isStrict, iterator, 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 SchemaObjectRegistry
contains, get, getOidByName, getSchemaName, getType, iterator, oidsIterator, register, renameSchema, size, unregister, unregisterSchemaElements
-
Constructor Details
-
DefaultAttributeTypeRegistry
public DefaultAttributeTypeRegistry()Creates a new default AttributeTypeRegistry instance.
-
-
Method Details
-
getNormalizerMapping
Gets an oid/name to normalizer mapping used to normalize distinguished names.- Specified by:
getNormalizerMappingin interfaceAttributeTypeRegistry- Returns:
- a map of OID Strings to OidNormalizer instances
-
hasDescendants
Quick lookup to see if an attribute has descendants.- Specified by:
hasDescendantsin interfaceAttributeTypeRegistry- Parameters:
ancestorId- the name alias or OID for an attributeType- Returns:
- an Iterator over the AttributeTypes which have the ancestor within their superior chain to the top
- Throws:
LdapException- if the ancestor attributeType cannot be discerned from the ancestorId supplied
-
hasDescendants
Quick lookup to see if an attribute has descendants.- Specified by:
hasDescendantsin interfaceAttributeTypeRegistry- Parameters:
ancestor- the attributeType we are looking for- Returns:
- an Iterator over the AttributeTypes which have the ancestor within their superior chain to the top
- Throws:
LdapException- if the ancestor attributeType cannot be discerned from the ancestorId supplied
-
descendants
Get's an iterator over the set of descendant attributeTypes for some ancestor's name alias or their OID.- Specified by:
descendantsin interfaceAttributeTypeRegistry- Parameters:
ancestorId- the name alias or OID for an attributeType- Returns:
- an Iterator over the AttributeTypes which have the ancestor within their superior chain to the top
- Throws:
LdapException- if the ancestor attributeType cannot be discerned from the ancestorId supplied
-
descendants
Get's an iterator over the set of descendant attributeTypes for some ancestor's name alias or their OID.- Specified by:
descendantsin interfaceAttributeTypeRegistry- Parameters:
ancestor- the AttributeType we are looking for- Returns:
- an Iterator over the AttributeTypes which have the ancestor within their superior chain to the top
- Throws:
LdapException- if the ancestor attributeType cannot be discerned from the ancestorId supplied
-
registerDescendants
public void registerDescendants(AttributeType attributeType, AttributeType ancestor) throws LdapException Store the AttributeType into a map associating an AttributeType to its descendants.- Specified by:
registerDescendantsin interfaceAttributeTypeRegistry- Parameters:
attributeType- The attributeType to registerancestor- The attributeType's parent- Throws:
LdapException- If something went wrong
-
unregisterDescendants
public void unregisterDescendants(AttributeType attributeType, AttributeType ancestor) throws LdapException Remove the AttributeType from the map associating an AttributeType to its descendants.- Specified by:
unregisterDescendantsin interfaceAttributeTypeRegistry- Parameters:
attributeType- The attributeType to unregisterancestor- its ancestor- Throws:
LdapException- If something went wrong
-
unregister
Removes the SchemaObject registered with this registry, using its numeric OID.- Specified by:
unregisterin interfaceSchemaObjectRegistry<AttributeType>- Overrides:
unregisterin classDefaultSchemaObjectRegistry<AttributeType>- Parameters:
numericOid- the numeric identifier- Returns:
- The unregistred schema object
- Throws:
LdapException- if the numeric identifier is invalid
-
addMappingFor
Add a new Oid/Normalizer couple in the OidNormalizer map- Specified by:
addMappingForin interfaceAttributeTypeRegistry- Parameters:
attributeType- The AttributeType to add- Throws:
LdapException- If something went wrong
-
removeMappingFor
Remove the AttributeType normalizer from the OidNormalizer map- Specified by:
removeMappingForin interfaceAttributeTypeRegistry- Parameters:
attributeType- The AttributeType to remove- Throws:
LdapException- If something went wrong
-
lookup
Looks up a SchemaObject by its unique Object Identifier or by name.- Specified by:
lookupin interfaceSchemaObjectRegistry<AttributeType>- Overrides:
lookupin classDefaultSchemaObjectRegistry<AttributeType>- Parameters:
oid- the object identifier or name- Returns:
- the SchemaObject instance for the id
- Throws:
LdapException- if the SchemaObject does not exist
-
copy
Copy a DefaultSchemaObjectRegistry. All the stored SchemaObject will also be copied, by the cross references will be lost.- Specified by:
copyin interfaceAttributeTypeRegistry- Specified by:
copyin interfaceSchemaObjectRegistry<AttributeType>- Returns:
- The copied registry
-
clear
public void clear()Clear the registry from all its content- Specified by:
clearin interfaceSchemaObjectRegistry<AttributeType>- Overrides:
clearin classDefaultSchemaObjectRegistry<AttributeType>
-