public class OidRegistry<T extends SchemaObject>
extends java.lang.Object
implements java.lang.Iterable<T>
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,T> |
byOid
Maps OID to a type of SchemaObject
|
private static boolean |
IS_DEBUG
Speedup for DEBUG mode
|
private boolean |
isRelaxed
A flag indicating that the Registry is relaxed or not
|
private static org.slf4j.Logger |
LOG
static class logger
|
| Constructor and Description |
|---|
OidRegistry() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
contains(java.lang.String oid)
Tells if the given OID is present on this registry
|
OidRegistry<T> |
copy()
Copy the OidRegistry, without the contained values
|
java.util.List<java.lang.String> |
getNameSet(java.lang.String oid)
Gets the names associated with an OID.
|
java.lang.String |
getPrimaryName(java.lang.String oid)
Gets the primary name associated with an OID.
|
T |
getSchemaObject(java.lang.String oid)
Gets the SchemaObject associated with an OID.
|
boolean |
isRelaxed()
Tells if the Registry is permissive or if it must be checked
against inconsistencies.
|
boolean |
isStrict()
Tells if the Registry is strict.
|
java.util.Iterator<T> |
iterator()
Lists all the SchemaObjects within the registry.
|
java.util.Iterator<java.lang.String> |
iteratorOids()
Lists all the OIDs within the registry.
|
(package private) void |
put(T schemaObject)
Store the given SchemaObject into the OidRegistry.
|
void |
register(T schemaObject)
Adds an OID name pair to the registry.
|
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() |
java.lang.String |
toString() |
void |
unregister(java.lang.String oid)
Removes an oid from this registry.
|
private static final org.slf4j.Logger LOG
private static final boolean IS_DEBUG
private java.util.Map<java.lang.String,T extends SchemaObject> byOid
private boolean isRelaxed
public boolean contains(java.lang.String oid)
oid - The OID to lookuppublic java.lang.String getPrimaryName(java.lang.String oid)
throws LdapException
oid - the object identifierLdapException - if oid does not existpublic T getSchemaObject(java.lang.String oid) throws LdapException
oid - the object identifierLdapException - if oid does not existpublic java.util.List<java.lang.String> getNameSet(java.lang.String oid)
throws LdapException
oid - the OID for which we return the set of common namesLdapException - if oid does not existpublic java.util.Iterator<java.lang.String> iteratorOids()
public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T extends SchemaObject>public boolean isRelaxed()
public boolean isStrict()
public void setRelaxed()
public void setStrict()
public void register(T schemaObject) throws LdapException
schemaObject - The SchemaObject the oid belongs toLdapExceptionvoid put(T schemaObject)
schemaObject - The SchemaObject to inject into the OidRegistrypublic void unregister(java.lang.String oid)
throws LdapException
oid - the numeric identifier for the objectLdapException - if the identifier is not numericpublic OidRegistry<T> copy()
public int size()
public void clear()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()