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
Fields Modifier and Type Field Description protected Map<Integer,DitStructureRule>byRuleIda map of DitStructureRule looked up by RuleId-
Fields inherited from class org.apache.directory.api.ldap.model.schema.registries.DefaultSchemaObjectRegistry
byName, oidRegistry, schemaObjectType
-
-
Constructor Summary
Constructors Constructor Description DefaultDitStructureRuleRegistry()Creates a new default NormalizerRegistry instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(int ruleId)Checks to see if an DitStructureRule exists in the registry, by its ruleId.DefaultDitStructureRuleRegistrycopy()Copy the DitStructureRuleRegistryStringgetSchemaName(int ruleId)Gets the name of the schema this schema object is associated with.Iterator<DitStructureRule>iterator()Gets an iterator over the registered schema objects in the registry.DitStructureRulelookup(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.Iterator<Integer>ruleIdIterator()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 org.apache.directory.api.ldap.model.schema.registries.DefaultSchemaObjectRegistry
clear, contains, copy, get, getErrorHandler, getOidByName, getSchemaName, getType, isRelaxed, isStrict, lookup, oidsIterator, setErrorHandler, setRelaxed, setStrict, size, toString, unregister, unregister
-
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, spliterator
-
Methods inherited from interface org.apache.directory.api.ldap.model.schema.registries.SchemaObjectRegistry
clear, contains, get, getOidByName, getSchemaName, getType, lookup, oidsIterator, size, unregister, unregister
-
-
-
-
Field Detail
-
byRuleId
protected Map<Integer,DitStructureRule> byRuleId
a map of DitStructureRule looked up by RuleId
-
-
Method Detail
-
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
public Iterator<DitStructureRule> 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
public Iterator<Integer> ruleIdIterator()
Gets an iterator over the registered ruleId in the registry.- Specified by:
ruleIdIteratorin interfaceDitStructureRuleRegistry- Returns:
- an Iterator of ruleId
-
getSchemaName
public String getSchemaName(int ruleId) throws LdapException
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
public void register(DitStructureRule ditStructureRule) throws LdapException
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
public DitStructureRule lookup(int ruleId) throws LdapException
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
public void unregister(int ruleId) throws LdapExceptionUnregisters 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
public void unregisterSchemaElements(String schemaName)
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
public void renameSchema(String originalSchemaName, String newSchemaName)
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
public DefaultDitStructureRuleRegistry copy()
Copy the DitStructureRuleRegistry- Specified by:
copyin interfaceDitStructureRuleRegistry- Specified by:
copyin interfaceSchemaObjectRegistry<DitStructureRule>- Returns:
- The copied registry
-
-