Class DefaultDitStructureRuleRegistry
java.lang.Object
org.apache.directory.api.ldap.model.schema.registries.DefaultSchemaObjectRegistry<DitStructureRule>
org.apache.directory.api.ldap.model.schema.registries.DefaultDitStructureRuleRegistry
- All Implemented Interfaces:
Iterable<DitStructureRule>, DitStructureRuleRegistry, SchemaObjectRegistry<DitStructureRule>
public class DefaultDitStructureRuleRegistry
extends DefaultSchemaObjectRegistry<DitStructureRule>
implements DitStructureRuleRegistry
A DitStructureRule registry's service default implementation.
- Author:
- Apache Directory Project
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<Integer, DitStructureRule> a map of DitStructureRule looked up by RuleIdFields inherited from class DefaultSchemaObjectRegistry
byName, oidRegistry, schemaObjectType -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new default NormalizerRegistry instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(int ruleId) Checks to see if an DitStructureRule exists in the registry, by its ruleId.copy()Copy a DefaultSchemaObjectRegistry.getSchemaName(int ruleId) Gets the name of the schema this schema object is associated with.iterator()Gets an iterator over the registered schema objects in the registry.lookup(int ruleId) Looks up an dITStructureRule by its unique Object IDentifier or by its name.voidregister(DitStructureRule ditStructureRule) Registers a new SchemaObject with this registry.voidrenameSchema(String originalSchemaName, String newSchemaName) Modify all the SchemaObject using a schemaName when this name changes.Gets an iterator over the registered ruleId in the registry.voidunregister(int ruleId) Unregisters a DitStructureRule using it's rule identifier.voidunregisterSchemaElements(String schemaName) Unregisters all SchemaObjects defined for a specific schema from this registry.Methods inherited from class DefaultSchemaObjectRegistry
clear, contains, copy, get, getErrorHandler, getOidByName, getSchemaName, getType, isRelaxed, isStrict, lookup, oidsIterator, setErrorHandler, setRelaxed, setStrict, size, toString, unregister, unregisterMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface SchemaObjectRegistry
clear, contains, get, getOidByName, getSchemaName, getType, lookup, oidsIterator, size, unregister, unregister
-
Field Details
-
byRuleId
a map of DitStructureRule looked up by RuleId
-
-
Constructor Details
-
DefaultDitStructureRuleRegistry
public DefaultDitStructureRuleRegistry()Creates a new default NormalizerRegistry instance.
-
-
Method Details
-
contains
public boolean contains(int ruleId) Checks to see if an DitStructureRule exists in the registry, by its ruleId.- Specified by:
containsin interfaceDitStructureRuleRegistry- Parameters:
ruleId- the rule identifier of the DitStructureRule- Returns:
- true if a DitStructureRule definition exists for the ruleId, false otherwise
-
iterator
Gets an iterator over the registered schema objects in the registry.- Specified by:
iteratorin interfaceDitStructureRuleRegistry- Specified by:
iteratorin interfaceIterable<DitStructureRule>- Specified by:
iteratorin interfaceSchemaObjectRegistry<DitStructureRule>- Overrides:
iteratorin classDefaultSchemaObjectRegistry<DitStructureRule>- Returns:
- an Iterator of homogeneous schema objects
-
ruleIdIterator
Gets an iterator over the registered ruleId in the registry.- Specified by:
ruleIdIteratorin interfaceDitStructureRuleRegistry- Returns:
- an Iterator of ruleId
-
getSchemaName
Gets the name of the schema this schema object is associated with.- Specified by:
getSchemaNamein interfaceDitStructureRuleRegistry- Parameters:
ruleId- the object identifier- Returns:
- the schema name
- Throws:
LdapException- if the schema object does not exist
-
register
Registers a new SchemaObject with this registry.- Specified by:
registerin interfaceDitStructureRuleRegistry- Specified by:
registerin interfaceSchemaObjectRegistry<DitStructureRule>- Overrides:
registerin classDefaultSchemaObjectRegistry<DitStructureRule>- Parameters:
ditStructureRule- the SchemaObject to register- Throws:
LdapException- if the SchemaObject is already registered or the registration operation is not supported
-
lookup
Looks up an dITStructureRule by its unique Object IDentifier or by its name.- Specified by:
lookupin interfaceDitStructureRuleRegistry- Parameters:
ruleId- the rule identifier for the DitStructureRule- Returns:
- the DitStructureRule instance for rule identifier
- Throws:
LdapException- if the DitStructureRule does not exist
-
unregister
Unregisters a DitStructureRule using it's rule identifier.- Specified by:
unregisterin interfaceDitStructureRuleRegistry- Parameters:
ruleId- the rule identifier for the DitStructureRule to unregister- Throws:
LdapException- if no such DitStructureRule exists
-
unregisterSchemaElements
Unregisters all SchemaObjects defined for a specific schema from this registry.- Specified by:
unregisterSchemaElementsin interfaceDitStructureRuleRegistry- Specified by:
unregisterSchemaElementsin interfaceSchemaObjectRegistry<DitStructureRule>- Overrides:
unregisterSchemaElementsin classDefaultSchemaObjectRegistry<DitStructureRule>- Parameters:
schemaName- the name of the schema whose SchemaObjects will be removed from
-
renameSchema
Modify all the SchemaObject using a schemaName when this name changes.- Specified by:
renameSchemain interfaceDitStructureRuleRegistry- Specified by:
renameSchemain interfaceSchemaObjectRegistry<DitStructureRule>- Overrides:
renameSchemain classDefaultSchemaObjectRegistry<DitStructureRule>- Parameters:
originalSchemaName- The original Schema namenewSchemaName- The new Schema name
-
copy
Copy a DefaultSchemaObjectRegistry. All the stored SchemaObject will also be copied, by the cross references will be lost.- Specified by:
copyin interfaceDitStructureRuleRegistry- Specified by:
copyin interfaceSchemaObjectRegistry<DitStructureRule>- Returns:
- The copied registry
-