Class ImmutableMatchingRuleRegistry
java.lang.Object
org.apache.directory.api.ldap.model.schema.registries.ImmutableMatchingRuleRegistry
- All Implemented Interfaces:
Iterable<MatchingRule>, MatchingRuleRegistry, SchemaObjectRegistry<MatchingRule>
An immutable wrapper of the MatchingRule registry.
- Author:
- Apache Directory Project
-
Constructor Summary
ConstructorsConstructorDescriptionImmutableMatchingRuleRegistry(MatchingRuleRegistry matchingRuleRegistry) Creates a new instance of ImmutableMatchingRuleRegistry. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the registry from all its contentbooleanChecks to see if an SchemaObject exists in the registry, by its OID or name.copy()Copy the MatchingRuleRegistryGets the SchemaObject associated with a given OID.getOidByName(String name) Gets the numericOid for a name/alias if one is associated.getSchemaName(String oid) Gets the name of the schema this schema object is associated with.getType()iterator()Gets an iterator over the registered schema objects in the registry.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(MatchingRule schemaObject) Registers a new SchemaObject with this registry.voidrenameSchema(String originalSchemaName, String newSchemaName) Modify all the SchemaObject using a schemaName when this name changes.intsize()unregister(String numericOid) Removes the SchemaObject registered with this registry, using its numeric OID.unregister(MatchingRule schemaObject) Removes the SchemaObject registered with this registry.voidunregisterSchemaElements(String schemaName) Unregisters all SchemaObjects 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
-
ImmutableMatchingRuleRegistry
Creates a new instance of ImmutableMatchingRuleRegistry.- Parameters:
matchingRuleRegistry- The wrapped MatchingRule registry
-
-
Method Details
-
copy
Copy the MatchingRuleRegistry- Specified by:
copyin interfaceMatchingRuleRegistry- Specified by:
copyin interfaceSchemaObjectRegistry<MatchingRule>- Returns:
- The copied registry
-
size
public int size()- Specified by:
sizein interfaceSchemaObjectRegistry<MatchingRule>- 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<MatchingRule>- 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<MatchingRule>- 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<MatchingRule>- 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<MatchingRule>- Returns:
- the type
-
iterator
Gets an iterator over the registered schema objects in the registry.- Specified by:
iteratorin interfaceIterable<MatchingRule>- Specified by:
iteratorin interfaceSchemaObjectRegistry<MatchingRule>- Returns:
- an Iterator of homogeneous schema objects
-
lookup
Looks up a SchemaObject by its unique Object Identifier or by name.- Specified by:
lookupin interfaceSchemaObjectRegistry<MatchingRule>- 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<MatchingRule>- Returns:
- an Iterator of OIDs
-
register
Registers a new SchemaObject with this registry.- Specified by:
registerin interfaceSchemaObjectRegistry<MatchingRule>- Parameters:
schemaObject- the SchemaObject to register- Throws:
LdapException- if the SchemaObject is already registered or the registration operation is not supported
-
renameSchema
Modify all the SchemaObject using a schemaName when this name changes.- Specified by:
renameSchemain interfaceSchemaObjectRegistry<MatchingRule>- Parameters:
originalSchemaName- The original Schema namenewSchemaName- The new Schema name- Throws:
LdapException- if the schema object does not exist
-
unregister
Removes the SchemaObject registered with this registry, using its numeric OID.- Specified by:
unregisterin interfaceSchemaObjectRegistry<MatchingRule>- Parameters:
numericOid- the numeric identifier- Returns:
- The unregistred schema object
- Throws:
LdapException- if the numeric identifier is invalid
-
unregisterSchemaElements
Unregisters all SchemaObjects defined for a specific schema from this registry.- Specified by:
unregisterSchemaElementsin interfaceSchemaObjectRegistry<MatchingRule>- Parameters:
schemaName- the name of the schema whose SchemaObjects will be removed from- Throws:
LdapException- If we had a problem while unregistering the schema
-
get
Gets the SchemaObject associated with a given OID.- Specified by:
getin interfaceSchemaObjectRegistry<MatchingRule>- 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<MatchingRule>- Throws:
LdapException- If we had a failure while clearing the registry
-
unregister
Removes the SchemaObject registered with this registry.- Specified by:
unregisterin interfaceSchemaObjectRegistry<MatchingRule>- Parameters:
schemaObject- the schemaObject to unregister- Returns:
- The unregistred schema object
- Throws:
LdapException- if the schemaObject can't be unregistered is invalid
-