T - The type of SchemaObjectpublic abstract class DefaultSchemaObjectRegistry<T extends SchemaObject> extends Object implements SchemaObjectRegistry<T>, Iterable<T>
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,T> |
byName
a map of SchemaObject looked up by name
|
private SchemaErrorHandler |
errorHandler |
private boolean |
isRelaxed
A flag indicating that the Registry is relaxed or not
|
private static org.slf4j.Logger |
LOG
static class logger
|
protected OidRegistry<T> |
oidRegistry
the global OID Registry
|
protected SchemaObjectType |
schemaObjectType
The SchemaObject type, used by the toString() method
|
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultSchemaObjectRegistry(SchemaObjectType schemaObjectType,
OidRegistry<T> oidRegistry)
Creates a new DefaultSchemaObjectRegistry instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the registry from all its content
|
boolean |
contains(String oid)
Checks to see if an SchemaObject exists in the registry, by its
OID or name.
|
SchemaObjectRegistry<T> |
copy(SchemaObjectRegistry<T> original)
Copy a SchemaObject registry
|
T |
get(String oid)
Gets the SchemaObject associated with a given OID.
|
SchemaErrorHandler |
getErrorHandler() |
String |
getOidByName(String name)
Gets the numericOid for a name/alias if one is associated.
|
String |
getSchemaName(String oid)
Gets the name of the schema this schema object is associated with.
|
SchemaObjectType |
getType() |
boolean |
isRelaxed()
Tells if the Registry is permissive or if it must be checked
against inconsistencies.
|
boolean |
isStrict()
Tells if the Registry is strict.
|
Iterator<T> |
iterator()
Gets an iterator over the registered schema objects in the registry.
|
T |
lookup(String oid)
Looks up a SchemaObject by its unique Object Identifier or by name.
|
Iterator<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(String originalSchemaName,
String newSchemaName)
Modify all the SchemaObject using a schemaName when this name changes.
|
void |
setErrorHandler(SchemaErrorHandler errorHandler) |
void |
setRelaxed()
Change the Registry to a relaxed mode, where invalid SchemaObjects
can be registered.
|
void |
setStrict()
Change the Registry to a strict mode, where invalid SchemaObjects
cannot be registered.
|
int |
size() |
String |
toString() |
T |
unregister(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(String schemaName)
Unregisters all SchemaObjects defined for a specific schema from
this registry.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcopyforEach, spliteratorprivate static final org.slf4j.Logger LOG
protected Map<String,T extends SchemaObject> byName
protected SchemaObjectType schemaObjectType
protected OidRegistry<T extends SchemaObject> oidRegistry
private boolean isRelaxed
private SchemaErrorHandler errorHandler
protected DefaultSchemaObjectRegistry(SchemaObjectType schemaObjectType, OidRegistry<T> oidRegistry)
schemaObjectType - The Schema Object typeoidRegistry - The OID registry to usepublic boolean isRelaxed()
public boolean isStrict()
public void setRelaxed()
public void setStrict()
public SchemaErrorHandler getErrorHandler()
public void setErrorHandler(SchemaErrorHandler errorHandler)
public boolean contains(String oid)
contains in interface SchemaObjectRegistry<T extends SchemaObject>oid - the object identifier or name of the SchemaObjectpublic String getSchemaName(String oid) throws LdapException
getSchemaName in interface SchemaObjectRegistry<T extends SchemaObject>oid - the object identifier or the nameLdapException - if the schema object does not existpublic void renameSchema(String originalSchemaName, String newSchemaName)
renameSchema in interface SchemaObjectRegistry<T extends SchemaObject>originalSchemaName - The original Schema namenewSchemaName - The new Schema namepublic Iterator<T> iterator()
iterator in interface Iterable<T extends SchemaObject>iterator in interface SchemaObjectRegistry<T extends SchemaObject>public Iterator<String> oidsIterator()
oidsIterator in interface SchemaObjectRegistry<T extends SchemaObject>public T lookup(String oid) throws LdapException
lookup in interface SchemaObjectRegistry<T extends SchemaObject>oid - the object identifier or nameLdapException - if the SchemaObject does not existpublic void register(T schemaObject) throws LdapException
register in interface SchemaObjectRegistry<T extends SchemaObject>schemaObject - the SchemaObject to registerLdapException - if the SchemaObject is already registered or
the registration operation is not supportedpublic T unregister(String numericOid) throws LdapException
unregister in interface SchemaObjectRegistry<T extends SchemaObject>numericOid - the numeric identifierLdapException - if the numeric identifier is invalidpublic T unregister(T schemaObject) throws LdapException
unregister in interface SchemaObjectRegistry<T extends SchemaObject>schemaObject - the schemaObject to unregisterLdapException - if the schemaObject can't be unregistered is invalidpublic void unregisterSchemaElements(String schemaName) throws LdapException
unregisterSchemaElements in interface SchemaObjectRegistry<T extends SchemaObject>schemaName - the name of the schema whose SchemaObjects will be removed fromLdapException - If we had a problem while unregistering the schemapublic String getOidByName(String name) throws LdapException
getOidByName in interface SchemaObjectRegistry<T extends SchemaObject>name - The name we are looking the oid forLdapException - If the OID can't be foundpublic SchemaObjectRegistry<T> copy(SchemaObjectRegistry<T> original)
original - The SchemaObject registry to copypublic T get(String oid)
get in interface SchemaObjectRegistry<T extends SchemaObject>oid - The SchemaObject's OID we are looking forpublic SchemaObjectType getType()
getType in interface SchemaObjectRegistry<T extends SchemaObject>public int size()
size in interface SchemaObjectRegistry<T extends SchemaObject>public String toString()
toString in class ObjectObject.toString()public void clear()
clear in interface SchemaObjectRegistry<T extends SchemaObject>Copyright © 2003–2019 The Apache Software Foundation. All rights reserved.