org.apache.directory.server.schema.registries
Class DefaultObjectClassRegistry

java.lang.Object
  extended by org.apache.directory.server.schema.registries.DefaultObjectClassRegistry
All Implemented Interfaces:
ObjectClassRegistry, SchemaObjectRegistry

public class DefaultObjectClassRegistry
extends java.lang.Object
implements ObjectClassRegistry

A plain old java object implementation of an ObjectClassRegistry.

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

Constructor Summary
DefaultObjectClassRegistry(OidRegistry oidRegistry)
          Creates an empty DefaultObjectClassRegistry.
 
Method Summary
 java.lang.String getSchemaName(java.lang.String id)
          Gets the name of the schema this schema object is associated with.
 boolean hasObjectClass(java.lang.String id)
          Checks to see if an objectClass exists.
 java.util.Iterator<org.apache.directory.shared.ldap.schema.ObjectClass> iterator()
          Gets an Iterator over the ObjectClasses within this ObjectClassRegistry.
 org.apache.directory.shared.ldap.schema.ObjectClass lookup(java.lang.String id)
          Looks up an objectClass by its unique Object Identifier or by name.
 void register(org.apache.directory.shared.ldap.schema.ObjectClass objectClass)
          Registers an ObjectClass with this registry.
 void unregister(java.lang.String numericOid)
          Removes the SchemaObject registered with this registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultObjectClassRegistry

public DefaultObjectClassRegistry(OidRegistry oidRegistry)
Creates an empty DefaultObjectClassRegistry.

Parameters:
oidRegistry - used by this registry for OID to name resolution of dependencies and to automatically register and unregister it's aliases and OIDs
Method Detail

register

public void register(org.apache.directory.shared.ldap.schema.ObjectClass objectClass)
              throws javax.naming.NamingException
Description copied from interface: ObjectClassRegistry
Registers an ObjectClass with this registry.

Specified by:
register in interface ObjectClassRegistry
Parameters:
objectClass - the objectClass to register
Throws:
javax.naming.NamingException - if the ObjectClass is already registered or the registration operation is not supported

lookup

public org.apache.directory.shared.ldap.schema.ObjectClass lookup(java.lang.String id)
                                                           throws javax.naming.NamingException
Description copied from interface: ObjectClassRegistry
Looks up an objectClass by its unique Object Identifier or by name.

Specified by:
lookup in interface ObjectClassRegistry
Parameters:
id - the object identifier or name
Returns:
the ObjectClass instance for the id
Throws:
javax.naming.NamingException - if the ObjectClass does not exist

hasObjectClass

public boolean hasObjectClass(java.lang.String id)
Description copied from interface: ObjectClassRegistry
Checks to see if an objectClass exists.

Specified by:
hasObjectClass in interface ObjectClassRegistry
Parameters:
id - the object identifier or name
Returns:
true if an objectClass definition exists for the id, false otherwise

getSchemaName

public java.lang.String getSchemaName(java.lang.String id)
                               throws javax.naming.NamingException
Description copied from interface: SchemaObjectRegistry
Gets the name of the schema this schema object is associated with.

Specified by:
getSchemaName in interface SchemaObjectRegistry
Parameters:
id - the object identifier or the name
Returns:
the schema name
Throws:
javax.naming.NamingException - if the schema object does not exist

iterator

public java.util.Iterator<org.apache.directory.shared.ldap.schema.ObjectClass> iterator()
Description copied from interface: ObjectClassRegistry
Gets an Iterator over the ObjectClasses within this ObjectClassRegistry.

Specified by:
iterator in interface ObjectClassRegistry
Specified by:
iterator in interface SchemaObjectRegistry
Returns:
an iterator over all ObjectClasses in registry

unregister

public void unregister(java.lang.String numericOid)
                throws javax.naming.NamingException
Description copied from interface: SchemaObjectRegistry
Removes the SchemaObject registered with this registry.

Specified by:
unregister in interface SchemaObjectRegistry
Parameters:
numericOid - the numeric identifier
Throws:
javax.naming.NamingException - if the numeric identifier is invalid


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