org.apache.directory.server.core.schema
Interface OidRegistry

All Known Implementing Classes:
BootstrapOidRegistry, GlobalOidRegistry

public interface OidRegistry

Object identifier registry.

Version:
$Rev: 434579 $
Author:
Apache Directory Project

Method Summary
 java.util.Map getNameByOid()
          Get the map of all the oids by their name
 java.util.List getNameSet(java.lang.String oid)
          Gets the names associated with an OID.
 java.lang.String getOid(java.lang.String name)
          Gets the object identifier for a common name or returns the argument as-is if it is an object identifier.
 java.util.Map getOidByName()
          Get the map of all the oids by their name
 java.lang.String getPrimaryName(java.lang.String oid)
          Gets the primary name associated with an OID.
 boolean hasOid(java.lang.String id)
          Checks to see if an identifier, oid or name exists within this registry.
 java.util.Iterator list()
          Lists all the OIDs within the registry.
 void register(java.lang.String name, java.lang.String oid)
          Adds an OID name pair to the registry.
 

Method Detail

getOid

public java.lang.String getOid(java.lang.String name)
                        throws javax.naming.NamingException
Gets the object identifier for a common name or returns the argument as-is if it is an object identifier.

Parameters:
name - the name to lookup an OID for
Returns:
the OID string associated with a name
Throws:
javax.naming.NamingException - if name does not map to an OID

hasOid

public boolean hasOid(java.lang.String id)
Checks to see if an identifier, oid or name exists within this registry.

Parameters:
id - the oid or name to look for
Returns:
true if the id exists false otherwise

getPrimaryName

public java.lang.String getPrimaryName(java.lang.String oid)
                                throws javax.naming.NamingException
Gets the primary name associated with an OID. The primary name is the first name specified for the OID.

Parameters:
oid - the object identifier
Returns:
the primary name
Throws:
javax.naming.NamingException - if oid does not exist

getNameSet

public java.util.List getNameSet(java.lang.String oid)
                          throws javax.naming.NamingException
Gets the names associated with an OID. An OID is unique however it may have many names used to refer to it. A good example is the cn and commonName attribute names for OID 2.5.4.3. Within a server one name within the set must be chosen as the primary name. This is used to name certain things within the server internally. If there is more than one name then the first name is taken to be the primary.

Parameters:
oid - the OID for which we return the set of common names
Returns:
a sorted set of names
Throws:
javax.naming.NamingException - if oid does not exist

list

public java.util.Iterator list()
Lists all the OIDs within the registry. This may be a really big list.

Returns:
all the OIDs registered

register

public void register(java.lang.String name,
                     java.lang.String oid)
Adds an OID name pair to the registry.

Parameters:
name - the name to associate with the OID
oid - the OID to add or associate a new name with

getOidByName

public java.util.Map getOidByName()
Get the map of all the oids by their name

Returns:
The Map that contains all the oids

getNameByOid

public java.util.Map getNameByOid()
Get the map of all the oids by their name

Returns:
The Map that contains all the oids