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

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

public class DefaultDitContentRuleRegistry
extends java.lang.Object
implements DITContentRuleRegistry

A plain old java object implementation of an DITContentRuleRegistry.

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

Constructor Summary
DefaultDitContentRuleRegistry(OidRegistry oidRegistry)
          Creates an empty DefaultDitContentRuleRegistry.
 
Method Summary
 java.lang.String getSchemaName(java.lang.String id)
          Gets the name of the schema this schema object is associated with.
 boolean hasDITContentRule(java.lang.String id)
          Checks to see if a DITContentRule exists.
 java.util.Iterator<org.apache.directory.shared.ldap.schema.DITContentRule> iterator()
          Lists the DITContentRules registered in this registry.
 org.apache.directory.shared.ldap.schema.DITContentRule lookup(java.lang.String id)
          Looks up a DITContentRule by its object identifier or by its name.
 void register(org.apache.directory.shared.ldap.schema.DITContentRule dITContentRule)
          Registers a DITContentRule 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

DefaultDitContentRuleRegistry

public DefaultDitContentRuleRegistry(OidRegistry oidRegistry)
Creates an empty DefaultDitContentRuleRegistry.

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.DITContentRule dITContentRule)
              throws javax.naming.NamingException
Description copied from interface: DITContentRuleRegistry
Registers a DITContentRule with this registry.

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

lookup

public org.apache.directory.shared.ldap.schema.DITContentRule lookup(java.lang.String id)
                                                              throws javax.naming.NamingException
Description copied from interface: DITContentRuleRegistry
Looks up a DITContentRule by its object identifier or by its name.

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

hasDITContentRule

public boolean hasDITContentRule(java.lang.String id)
Description copied from interface: DITContentRuleRegistry
Checks to see if a DITContentRule exists.

Specified by:
hasDITContentRule in interface DITContentRuleRegistry
Parameters:
id - the object identifier or name of the DITContentRule
Returns:
true if a DITContentRule 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.DITContentRule> iterator()
Description copied from interface: DITContentRuleRegistry
Lists the DITContentRules registered in this registry.

Specified by:
iterator in interface DITContentRuleRegistry
Specified by:
iterator in interface SchemaObjectRegistry
Returns:
an Iterator of DITContentRules

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.