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

All Known Implementing Classes:
DefaultOidRegistry

public interface OidRegistry

Object identifier registry.

Version:
$Rev: 568070 $
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.
 void unregister(java.lang.String numericOid)
          Removes an oid from this registry.
 

Method Detail

getOid

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

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

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

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

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

Returns:
all the OIDs registered

register

void register(java.lang.String name,
              java.lang.String oid)
              throws javax.naming.NamingException
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
Throws:
javax.naming.NamingException

getOidByName

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

Returns:
The Map that contains all the oids

getNameByOid

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

Returns:
The Map that contains all the oids

unregister

void unregister(java.lang.String numericOid)
                throws javax.naming.NamingException
Removes an oid from this registry.

Parameters:
numericOid - the numeric identifier for the object
Throws:
javax.naming.NamingException - if the identifier is not numeric


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