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 org.apache.directory.api.ldap.model.schema.registries.DefaultSchemaObjectRegistry
byName, oidRegistry, schemaObjectType
-
-
Constructor Summary
Constructors Constructor Description DefaultAttributeTypeRegistry()Creates a new default AttributeTypeRegistry instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMappingFor(AttributeType attributeType)Add a new Oid/Normalizer couple in the OidNormalizer mapvoidclear()Clear the registry from all its contentDefaultAttributeTypeRegistrycopy()Copy the AttributeTypeRegistryIterator<AttributeType>descendants(String ancestorId)Get's an iterator over the set of descendant attributeTypes for some ancestor's name alias or their OID.Iterator<AttributeType>descendants(AttributeType ancestor)Get's an iterator over the set of descendant attributeTypes for some ancestor's name alias or their OID.Map<String,OidNormalizer>getNormalizerMapping()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.AttributeTypelookup(String oid)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 mapAttributeTypeunregister(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 org.apache.directory.api.ldap.model.schema.registries.DefaultSchemaObjectRegistry
contains, copy, get, getErrorHandler, getOidByName, getSchemaName, getType, isRelaxed, isStrict, iterator, 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.SchemaObjectRegistry
contains, get, getOidByName, getSchemaName, getType, iterator, oidsIterator, register, renameSchema, size, unregister, unregisterSchemaElements
-
-
-
-
Method Detail
-
getNormalizerMapping
public Map<String,OidNormalizer> 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
public boolean hasDescendants(String ancestorId) throws LdapException
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
public boolean hasDescendants(AttributeType ancestor) throws LdapException
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
public Iterator<AttributeType> descendants(String ancestorId) throws LdapException
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
public Iterator<AttributeType> descendants(AttributeType ancestor) throws LdapException
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
public AttributeType unregister(String numericOid) throws LdapException
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
public void addMappingFor(AttributeType attributeType) throws LdapException
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
public void removeMappingFor(AttributeType attributeType) throws LdapException
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
public AttributeType lookup(String oid) throws LdapException
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
public DefaultAttributeTypeRegistry copy()
Copy the AttributeTypeRegistry- Specified by:
copyin interfaceAttributeTypeRegistry- Specified by:
copyin interfaceSchemaObjectRegistry<AttributeType>- Returns:
- The copied AttributeTypeRegistry
-
clear
public void clear()
Clear the registry from all its content- Specified by:
clearin interfaceSchemaObjectRegistry<AttributeType>- Overrides:
clearin classDefaultSchemaObjectRegistry<AttributeType>
-
-