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
-
-
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 boolean
contains(int ruleId)
Checks to see if an DitStructureRule exists in the registry, by its ruleId.DefaultDitStructureRuleRegistry
copy()
Copy the DitStructureRuleRegistryString
getSchemaName(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.DitStructureRule
lookup(int ruleId)
Looks up an dITStructureRule by its unique Object IDentifier or by its name.void
register(DitStructureRule ditStructureRule)
Registers a new SchemaObject with this registry.void
renameSchema(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.void
unregister(int ruleId)
Unregisters a DitStructureRule using it's rule identifier.void
unregisterSchemaElements(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
equals, 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
-
-
-
-
Constructor Detail
-
DefaultDitStructureRuleRegistry
public DefaultDitStructureRuleRegistry()
Creates a new default NormalizerRegistry instance.
-
-
Method Detail
-
contains
public boolean contains(int ruleId)
Checks to see if an DitStructureRule exists in the registry, by its ruleId.- Specified by:
contains
in 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:
iterator
in interfaceDitStructureRuleRegistry
- Specified by:
iterator
in interfaceIterable<DitStructureRule>
- Specified by:
iterator
in interfaceSchemaObjectRegistry<DitStructureRule>
- Overrides:
iterator
in 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:
ruleIdIterator
in 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:
getSchemaName
in 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:
register
in interfaceDitStructureRuleRegistry
- Specified by:
register
in interfaceSchemaObjectRegistry<DitStructureRule>
- Overrides:
register
in 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:
lookup
in 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 LdapException
Unregisters a DitStructureRule using it's rule identifier.- Specified by:
unregister
in 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:
unregisterSchemaElements
in interfaceDitStructureRuleRegistry
- Specified by:
unregisterSchemaElements
in interfaceSchemaObjectRegistry<DitStructureRule>
- Overrides:
unregisterSchemaElements
in 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:
renameSchema
in interfaceDitStructureRuleRegistry
- Specified by:
renameSchema
in interfaceSchemaObjectRegistry<DitStructureRule>
- Overrides:
renameSchema
in classDefaultSchemaObjectRegistry<DitStructureRule>
- Parameters:
originalSchemaName
- The original Schema namenewSchemaName
- The new Schema name
-
copy
public DefaultDitStructureRuleRegistry copy()
Copy the DitStructureRuleRegistry- Specified by:
copy
in interfaceDitStructureRuleRegistry
- Specified by:
copy
in interfaceSchemaObjectRegistry<DitStructureRule>
- Returns:
- The copied registry
-
-