Interface SchemaObjectRegistry<T extends SchemaObject>
- Type Parameters:
T- The SchemaObject type
- All Known Subinterfaces:
AttributeTypeRegistry, ComparatorRegistry, DitContentRuleRegistry, DitStructureRuleRegistry, LdapSyntaxRegistry, MatchingRuleRegistry, MatchingRuleUseRegistry, NameFormRegistry, NormalizerRegistry, ObjectClassRegistry, SyntaxCheckerRegistry
- All Known Implementing Classes:
DefaultAttributeTypeRegistry, DefaultComparatorRegistry, DefaultDitContentRuleRegistry, DefaultDitStructureRuleRegistry, DefaultLdapSyntaxRegistry, DefaultMatchingRuleRegistry, DefaultMatchingRuleUseRegistry, DefaultNameFormRegistry, DefaultNormalizerRegistry, DefaultObjectClassRegistry, DefaultSchemaObjectRegistry, DefaultSyntaxCheckerRegistry, ImmutableAttributeTypeRegistry, ImmutableComparatorRegistry, ImmutableDitContentRuleRegistry, ImmutableDitStructureRuleRegistry, ImmutableLdapSyntaxRegistry, ImmutableMatchingRuleRegistry, ImmutableMatchingRuleUseRegistry, ImmutableNameFormRegistry, ImmutableNormalizerRegistry, ImmutableObjectClassRegistry, ImmutableSyntaxCheckerRegistry
public interface SchemaObjectRegistry<T extends SchemaObject>
Common schema object registry interface.
- Author:
- Apache Directory Project
-
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 a DefaultSchemaObjectRegistry.Gets 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.voidRegisters 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(T schemaObject) Removes the SchemaObject registered with this registry.voidunregisterSchemaElements(String schemaName) Unregisters all SchemaObjects defined for a specific schema from this registry.
-
Method Details
-
contains
Checks to see if an SchemaObject exists in the registry, by its OID or name.- Parameters:
oid- the object identifier or name of the SchemaObject- Returns:
- true if a SchemaObject definition exists for the oid, false otherwise
-
getSchemaName
Gets the name of the schema this schema object is associated with.- Parameters:
oid- the object identifier or the name- Returns:
- the schema name
- Throws:
LdapException- if the schema object does not exist
-
get
-
renameSchema
Modify all the SchemaObject using a schemaName when this name changes.- Parameters:
originalSchemaName- The original Schema namenewSchemaName- The new Schema name- Throws:
LdapException- if the schema object does not exist
-
iterator
-
oidsIterator
-
lookup
Looks up a SchemaObject by its unique Object Identifier or by name.- Parameters:
oid- the object identifier or name- Returns:
- the SchemaObject instance for the id
- Throws:
LdapException- if the SchemaObject does not exist
-
register
Registers a new SchemaObject with this registry.- Parameters:
schemaObject- the SchemaObject to register- Throws:
LdapException- if the SchemaObject is already registered or the registration operation is not supported
-
unregister
Removes the SchemaObject registered with this registry, using its numeric OID.- Parameters:
numericOid- the numeric identifier- Returns:
- The unregistred schema object
- Throws:
LdapException- if the numeric identifier is invalid
-
unregister
Removes the SchemaObject registered with this registry.- Parameters:
schemaObject- the schemaObject to unregister- Returns:
- The unregistred schema object
- Throws:
LdapException- if the schemaObject can't be unregistered is invalid
-
unregisterSchemaElements
Unregisters all SchemaObjects defined for a specific schema from this registry.- Parameters:
schemaName- the name of the schema whose SchemaObjects will be removed from- Throws:
LdapException- If we had a problem while unregistering the schema
-
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.- 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
-
copy
SchemaObjectRegistry<T> copy()Copy a DefaultSchemaObjectRegistry. All the stored SchemaObject will also be copied, by the cross references will be lost.- Returns:
- The copied registry
-
getType
SchemaObjectType getType()- Returns:
- the type
-
size
int size()- Returns:
- The number of AttributeType stored
-
clear
Clear the registry from all its content- Throws:
LdapException- If we had a failure while clearing the registry
-