public class ImmutableAttributeTypeRegistry extends Object implements AttributeTypeRegistry
Constructor and Description |
---|
ImmutableAttributeTypeRegistry(AttributeTypeRegistry attributeTypeRegistry)
Creates a new instance of ImmutableAttributeTypeRegistry.
|
Modifier and Type | Method and Description |
---|---|
void |
addMappingFor(AttributeType attributeType)
Add a new Oid/Normalizer couple in the OidNormalizer map
|
void |
clear()
Clear the registry from all its content
|
boolean |
contains(String oid)
Checks to see if an SchemaObject exists in the registry, by its
OID or name.
|
AttributeTypeRegistry |
copy()
Copy the AttributeTypeRegistry
|
Iterator<AttributeType> |
descendants(AttributeType ancestor)
Get's an iterator over the set of descendant attributeTypes for
some ancestor's name alias or their OID.
|
Iterator<AttributeType> |
descendants(String ancestorId)
Get's an iterator over the set of descendant attributeTypes for
some ancestor's name alias or their OID.
|
AttributeType |
get(String oid)
Gets the SchemaObject associated with a given OID.
|
Map<String,OidNormalizer> |
getNormalizerMapping()
Gets an oid/name to normalizer mapping used to normalize distinguished
names.
|
String |
getOidByName(String name)
Gets the numericOid for a name/alias if one is associated.
|
String |
getSchemaName(String oid)
Gets the name of the schema this schema object is associated with.
|
SchemaObjectType |
getType() |
boolean |
hasDescendants(AttributeType ancestor)
Quick lookup to see if an attribute has descendants.
|
boolean |
hasDescendants(String ancestorId)
Quick lookup to see if an attribute has descendants.
|
Iterator<AttributeType> |
iterator()
Gets an iterator over the registered schema objects in the registry.
|
AttributeType |
lookup(String oid)
Looks up a SchemaObject by its unique Object Identifier or by name.
|
Iterator<String> |
oidsIterator()
Gets an iterator over the registered schema objects'OID in the registry.
|
void |
register(AttributeType attributeType)
Registers a new SchemaObject with this registry.
|
void |
registerDescendants(AttributeType attributeType,
AttributeType ancestor)
Store the AttributeType into a map associating an AttributeType to its
descendants.
|
void |
removeMappingFor(AttributeType attributeType)
Remove a new Oid/Normalizer couple in the OidNormalizer map
|
void |
renameSchema(String originalSchemaName,
String newSchemaName)
Modify all the SchemaObject using a schemaName when this name changes.
|
int |
size() |
String |
toString() |
AttributeType |
unregister(AttributeType schemaObject)
Removes the SchemaObject registered with this registry.
|
AttributeType |
unregister(String numericOid)
Removes the SchemaObject registered with this registry, using its
numeric OID.
|
void |
unregisterDescendants(AttributeType attributeType,
AttributeType ancestor)
Remove the AttributeType from the map associating an AttributeType to its
descendants.
|
void |
unregisterSchemaElements(String schemaName)
Unregisters all SchemaObjects defined for a specific schema from
this registry.
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ImmutableAttributeTypeRegistry(AttributeTypeRegistry attributeTypeRegistry)
attributeTypeRegistry
- The wrapped AttributeType registrypublic Map<String,OidNormalizer> getNormalizerMapping()
getNormalizerMapping
in interface AttributeTypeRegistry
public boolean hasDescendants(String ancestorId) throws LdapException
hasDescendants
in interface AttributeTypeRegistry
ancestorId
- the name alias or OID for an attributeTypeLdapException
- if the ancestor attributeType cannot be
discerned from the ancestorId suppliedpublic boolean hasDescendants(AttributeType ancestor) throws LdapException
hasDescendants
in interface AttributeTypeRegistry
ancestor
- the attributeType we are looking forLdapException
- if the ancestor attributeType cannot be
discerned from the ancestorId suppliedpublic Iterator<AttributeType> descendants(String ancestorId) throws LdapException
descendants
in interface AttributeTypeRegistry
ancestorId
- the name alias or OID for an attributeTypeLdapException
- if the ancestor attributeType cannot be
discerned from the ancestorId suppliedpublic Iterator<AttributeType> descendants(AttributeType ancestor) throws LdapException
descendants
in interface AttributeTypeRegistry
ancestor
- the AttributeType we are looking forLdapException
- if the ancestor attributeType cannot be
discerned from the ancestorId suppliedpublic void register(AttributeType attributeType) throws LdapException
register
in interface SchemaObjectRegistry<AttributeType>
attributeType
- the SchemaObject to registerLdapException
- if the SchemaObject is already registered or
the registration operation is not supportedpublic void registerDescendants(AttributeType attributeType, AttributeType ancestor) throws LdapException
registerDescendants
in interface AttributeTypeRegistry
attributeType
- The attributeType to registerancestor
- The attributeType's parentLdapException
- If something went wrongpublic void unregisterDescendants(AttributeType attributeType, AttributeType ancestor) throws LdapException
unregisterDescendants
in interface AttributeTypeRegistry
attributeType
- The attributeType to unregisterancestor
- its ancestorLdapException
- If something went wrongpublic AttributeType unregister(String numericOid) throws LdapException
unregister
in interface SchemaObjectRegistry<AttributeType>
numericOid
- the numeric identifierLdapException
- if the numeric identifier is invalidpublic void addMappingFor(AttributeType attributeType) throws LdapException
addMappingFor
in interface AttributeTypeRegistry
attributeType
- The AttributeType to addLdapException
- If something went wrongpublic void removeMappingFor(AttributeType attributeType) throws LdapException
removeMappingFor
in interface AttributeTypeRegistry
attributeType
- The AttributeType to removeLdapException
- If something went wrongpublic AttributeType lookup(String oid) throws LdapException
lookup
in interface SchemaObjectRegistry<AttributeType>
oid
- the object identifier or nameLdapException
- if the SchemaObject does not existpublic AttributeTypeRegistry copy()
copy
in interface AttributeTypeRegistry
copy
in interface SchemaObjectRegistry<AttributeType>
public int size()
size
in interface SchemaObjectRegistry<AttributeType>
public Iterator<AttributeType> iterator()
iterator
in interface Iterable<AttributeType>
iterator
in interface SchemaObjectRegistry<AttributeType>
public Iterator<String> oidsIterator()
oidsIterator
in interface SchemaObjectRegistry<AttributeType>
public boolean contains(String oid)
contains
in interface SchemaObjectRegistry<AttributeType>
oid
- the object identifier or name of the SchemaObjectpublic String getOidByName(String name) throws LdapException
getOidByName
in interface SchemaObjectRegistry<AttributeType>
name
- The name we are looking the oid forLdapException
- If the OID can't be foundpublic String getSchemaName(String oid) throws LdapException
getSchemaName
in interface SchemaObjectRegistry<AttributeType>
oid
- the object identifier or the nameLdapException
- if the schema object does not existpublic SchemaObjectType getType()
getType
in interface SchemaObjectRegistry<AttributeType>
public void renameSchema(String originalSchemaName, String newSchemaName)
renameSchema
in interface SchemaObjectRegistry<AttributeType>
originalSchemaName
- The original Schema namenewSchemaName
- The new Schema namepublic void unregisterSchemaElements(String schemaName) throws LdapException
unregisterSchemaElements
in interface SchemaObjectRegistry<AttributeType>
schemaName
- the name of the schema whose SchemaObjects will be removed fromLdapException
- If we had a problem while unregistering the schemapublic AttributeType get(String oid)
get
in interface SchemaObjectRegistry<AttributeType>
oid
- The SchemaObject's OID we are looking forpublic void clear() throws LdapException
clear
in interface SchemaObjectRegistry<AttributeType>
LdapException
- If we had a failure while clearing the registrypublic AttributeType unregister(AttributeType schemaObject) throws LdapException
unregister
in interface SchemaObjectRegistry<AttributeType>
schemaObject
- the schemaObject to unregisterLdapException
- if the schemaObject can't be unregistered is invalidCopyright © 2003–2018 The Apache Software Foundation. All rights reserved.