org.apache.directory.shared.ldap.schema.registries
Interface SchemaObjectRegistry<T extends SchemaObject>

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.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Method Summary
 void clear()
          Clear the registry from all its content
 boolean contains(java.lang.String oid)
          Checks to see if an SchemaObject exists in the registry, by its OID or name.
 SchemaObjectRegistry<T> copy()
          Copy a DefaultSchemaObjectRegistry.
 SchemaObject get(java.lang.String oid)
          Gets the SchemaObject associated with a given OID.
 java.lang.String getOidByName(java.lang.String name)
          Gets the numericOid for a name/alias if one is associated.
 java.lang.String getSchemaName(java.lang.String oid)
          Gets the name of the schema this schema object is associated with.
 SchemaObjectType getType()
           
 java.util.Iterator<T> iterator()
          Gets an iterator over the registered schema objects in the registry.
 T lookup(java.lang.String oid)
          Looks up a SchemaObject by its unique Object Identifier or by name.
 java.util.Iterator<java.lang.String> oidsIterator()
          Gets an iterator over the registered schema objects'OID in the registry.
 void register(T schemaObject)
          Registers a new SchemaObject with this registry.
 void renameSchema(java.lang.String originalSchemaName, java.lang.String newSchemaName)
          Modify all the SchemaObject using a schemaName when this name changes.
 int size()
           
 T unregister(java.lang.String numericOid)
          Removes the SchemaObject registered with this registry, using its numeric OID.
 T unregister(T schemaObject)
          Removes the SchemaObject registered with this registry.
 void unregisterSchemaElements(java.lang.String schemaName)
          Unregisters all SchemaObjects defined for a specific schema from this registry.
 

Method Detail

contains

boolean contains(java.lang.String oid)
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

java.lang.String getSchemaName(java.lang.String oid)
                               throws LdapException
Gets the name of the schema this schema object is associated with.

Parameters:
id - the object identifier or the name
Returns:
the schema name
Throws:
LdapException - if the schema object does not exist

get

SchemaObject get(java.lang.String oid)
Gets the SchemaObject associated with a given OID.

Parameters:
oid - The SchemaObject's OID we are looking for
Returns:
The SchemaObject, if any. Null otherwise

renameSchema

void renameSchema(java.lang.String originalSchemaName,
                  java.lang.String newSchemaName)
                  throws LdapException
Modify all the SchemaObject using a schemaName when this name changes.

Parameters:
originalSchemaName - The original Schema name
newSchemaName - The new Schema name
Throws:
LdapException - if the schema object does not exist

iterator

java.util.Iterator<T> iterator()
Gets an iterator over the registered schema objects in the registry.

Returns:
an Iterator of homogeneous schema objects

oidsIterator

java.util.Iterator<java.lang.String> oidsIterator()
Gets an iterator over the registered schema objects'OID in the registry.

Returns:
an Iterator of OIDs

lookup

T lookup(java.lang.String oid)
                              throws LdapException
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

void register(T schemaObject)
              throws LdapException
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

T unregister(java.lang.String numericOid)
                                  throws LdapException
Removes the SchemaObject registered with this registry, using its numeric OID.

Parameters:
numericOid - the numeric identifier
Throws:
LdapException - if the numeric identifier is invalid

unregister

T unregister(T schemaObject)
                                  throws LdapException
Removes the SchemaObject registered with this registry.

Parameters:
T - the schemaObject to unregister
Throws:
LdapException - if the schemaObject can't be unregistered is invalid

unregisterSchemaElements

void unregisterSchemaElements(java.lang.String schemaName)
                              throws LdapException
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

getOidByName

java.lang.String getOidByName(java.lang.String name)
                              throws LdapException
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:
SchemaObjectRegistry The copied registry

getType

SchemaObjectType getType()
Returns:
the type

size

int size()
Returns:
The number of AttributeType stored

clear

void clear()
           throws LdapException
Clear the registry from all its content

Throws:
LdapException


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.