Class ImmutableDitStructureRuleRegistry
java.lang.Object
org.apache.directory.api.ldap.model.schema.registries.ImmutableDitStructureRuleRegistry
- All Implemented Interfaces:
Iterable<DitStructureRule>, DitStructureRuleRegistry, SchemaObjectRegistry<DitStructureRule>
An immutable wrapper of the DitStructureRule registry.
- Author:
- Apache Directory Project
-
Constructor Summary
ConstructorsConstructorDescriptionImmutableDitStructureRuleRegistry(DitStructureRuleRegistry ditStructureRuleRegistry) Creates a new instance of ImmutableDitStructureRuleRegistry. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the registry from all its contentbooleancontains(int ruleId) Checks to see if an DitStructureRule exists in the registry, by its ruleId.booleanChecks to see if an SchemaObject exists in the registry, by its OID or name.copy()Copy the DitStructureRuleRegistryGets the SchemaObject associated with a given OID.getOidByName(String name) Gets the numericOid for a name/alias if one is associated.getSchemaName(int ruleId) Gets the name of the schema this schema object is associated with.getSchemaName(String oid) Gets the name of the schema this schema object is associated with.getType()iterator()Gets an iterator over the registered descriptions in the registry.lookup(int ruleId) Looks up an dITStructureRule by its unique Object IDentifier or by its name.Looks up a SchemaObject by its unique Object Identifier or by name.Gets an iterator over the registered schema objects'OID in the registry.voidregister(DitStructureRule ditStructureRule) Registers a new DitStructureRule with this registry.voidrenameSchema(String originalSchemaName, String newSchemaName) Modify all the DitStructureRule using a schemaName when this name changes.Gets an iterator over the registered ruleId in the registry.intsize()voidunregister(int ruleId) Unregisters a DitStructureRule using it's rule identifier.unregister(String numericOid) Removes the SchemaObject registered with this registry, using its numeric OID.unregister(DitStructureRule schemaObject) Removes the SchemaObject registered with this registry.voidunregisterSchemaElements(String schemaName) Unregisters all DITStructureRules defined for a specific schema from this registry.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
ImmutableDitStructureRuleRegistry
Creates a new instance of ImmutableDitStructureRuleRegistry.- Parameters:
ditStructureRuleRegistry- The wrapped DitStructureRule registry
-
-
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 descriptions in the registry.- Specified by:
iteratorin interfaceDitStructureRuleRegistry- Specified by:
iteratorin interfaceIterable<DitStructureRule>- Specified by:
iteratorin interfaceSchemaObjectRegistry<DitStructureRule>- Returns:
- an Iterator of descriptions
-
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 DitStructureRule with this registry.- Specified by:
registerin interfaceDitStructureRuleRegistry- Specified by:
registerin interfaceSchemaObjectRegistry<DitStructureRule>- Parameters:
ditStructureRule- the DitStructureRule to register- Throws:
LdapException- if the DitStructureRule 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 DITStructureRules defined for a specific schema from this registry.- Specified by:
unregisterSchemaElementsin interfaceDitStructureRuleRegistry- Specified by:
unregisterSchemaElementsin interfaceSchemaObjectRegistry<DitStructureRule>- Parameters:
schemaName- the name of the schema whose syntaxCheckers will be removed from- Throws:
LdapException- if no such SchemaElement exists
-
renameSchema
Modify all the DitStructureRule using a schemaName when this name changes.- Specified by:
renameSchemain interfaceDitStructureRuleRegistry- Specified by:
renameSchemain interfaceSchemaObjectRegistry<DitStructureRule>- Parameters:
originalSchemaName- The original Schema namenewSchemaName- The new Schema name- Throws:
LdapException- if the schema can't be renamed
-
copy
Copy the DitStructureRuleRegistry- Specified by:
copyin interfaceDitStructureRuleRegistry- Specified by:
copyin interfaceSchemaObjectRegistry<DitStructureRule>- Returns:
- The copied registry
-
size
public int size()- Specified by:
sizein interfaceSchemaObjectRegistry<DitStructureRule>- Returns:
- The number of AttributeType stored
-
contains
Checks to see if an SchemaObject exists in the registry, by its OID or name.- Specified by:
containsin interfaceSchemaObjectRegistry<DitStructureRule>- Parameters:
oid- the object identifier or name of the SchemaObject- Returns:
- true if a SchemaObject definition exists for the oid, false otherwise
-
getOidByName
Gets the numericOid for a name/alias if one is associated. To prevent lookup failures due to case variance in the name, a failure to lookup the OID, will trigger a lookup using a lower cased version of the name and the name that failed to match will automatically be associated with the OID.- Specified by:
getOidByNamein interfaceSchemaObjectRegistry<DitStructureRule>- Parameters:
name- The name we are looking the oid for- Returns:
- The numericOID associated with this name
- Throws:
LdapException- If the OID can't be found
-
getSchemaName
Gets the name of the schema this schema object is associated with.- Specified by:
getSchemaNamein interfaceSchemaObjectRegistry<DitStructureRule>- Parameters:
oid- the object identifier or the name- Returns:
- the schema name
- Throws:
LdapException- if the schema object does not exist
-
getType
- Specified by:
getTypein interfaceSchemaObjectRegistry<DitStructureRule>- Returns:
- the type
-
lookup
Looks up a SchemaObject by its unique Object Identifier or by name.- Specified by:
lookupin interfaceSchemaObjectRegistry<DitStructureRule>- Parameters:
oid- the object identifier or name- Returns:
- the SchemaObject instance for the id
- Throws:
LdapException- if the SchemaObject does not exist
-
oidsIterator
Gets an iterator over the registered schema objects'OID in the registry.- Specified by:
oidsIteratorin interfaceSchemaObjectRegistry<DitStructureRule>- Returns:
- an Iterator of OIDs
-
unregister
Removes the SchemaObject registered with this registry, using its numeric OID.- Specified by:
unregisterin interfaceSchemaObjectRegistry<DitStructureRule>- Parameters:
numericOid- the numeric identifier- Returns:
- The unregistred schema object
- Throws:
LdapException- if the numeric identifier is invalid
-
get
Gets the SchemaObject associated with a given OID.- Specified by:
getin interfaceSchemaObjectRegistry<DitStructureRule>- Parameters:
oid- The SchemaObject's OID we are looking for- Returns:
- The SchemaObject, if any. Null otherwise
-
clear
Clear the registry from all its content- Specified by:
clearin interfaceSchemaObjectRegistry<DitStructureRule>- Throws:
LdapException- If we had a failure while clearing the registry
-
unregister
Removes the SchemaObject registered with this registry.- Specified by:
unregisterin interfaceSchemaObjectRegistry<DitStructureRule>- Parameters:
schemaObject- the schemaObject to unregister- Returns:
- The unregistred schema object
- Throws:
LdapException- if the schemaObject can't be unregistered is invalid
-