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

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

public class DefaultDitStructureRuleRegistry
extends java.lang.Object
implements DITStructureRuleRegistry

A plain old java object implementation of an DITStructureRuleRegistry.

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

Constructor Summary
DefaultDitStructureRuleRegistry(OidRegistry oidRegistry)
          Creates an empty DefaultDitStructureRuleRegistry.
 
Method Summary
 java.lang.String getSchemaName(java.lang.Integer ruleId)
          Gets the schema name for a DITStructureRule using the rule identifier.
 java.lang.String getSchemaName(java.lang.String id)
          Gets the name of the schema this schema object is associated with.
 boolean hasDITStructureRule(java.lang.Integer ruleId)
          Checks to see if an dITStructureRule exists using the rule identifier.
 boolean hasDITStructureRule(java.lang.String id)
          Checks to see if an dITStructureRule exists using the object identifier of the nameForm appended with the rule identifier of the DITStructureRule.
 java.util.Iterator<org.apache.directory.shared.ldap.schema.DITStructureRule> iterator()
          Lists all the DITStructureRules within this registry.
 org.apache.directory.shared.ldap.schema.DITStructureRule lookup(java.lang.Integer ruleId)
          Looks up an dITStructureRule by its unique Object IDentifier or by its name.
 org.apache.directory.shared.ldap.schema.DITStructureRule lookup(java.lang.String id)
          Looks up an dITStructureRule using a composite key composed of the nameForm object identifier with a DOT and the rule id of the DITStructureRule appended to it.
 void register(org.apache.directory.shared.ldap.schema.DITStructureRule dITStructureRule)
          Registers a DITStructureRule with this registry.
 void unregister(java.lang.Integer ruleId)
          Unregisters a DITStructureRule using it's rule identifier.
 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

DefaultDitStructureRuleRegistry

public DefaultDitStructureRuleRegistry(OidRegistry oidRegistry)
Creates an empty DefaultDitStructureRuleRegistry.

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

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

lookup

public org.apache.directory.shared.ldap.schema.DITStructureRule lookup(java.lang.String id)
                                                                throws javax.naming.NamingException
Description copied from interface: DITStructureRuleRegistry
Looks up an dITStructureRule using a composite key composed of the nameForm object identifier with a DOT and the rule id of the DITStructureRule appended to it. If the name form object identifier is 1.2.3.4 and the rule identifier is 5 then the OID used for the lookup is 1.2.3.4.5.

Specified by:
lookup in interface DITStructureRuleRegistry
Parameters:
id - the nameForm object identifier with rule identifier appended
Returns:
the DITStructureRule instance for the id
Throws:
javax.naming.NamingException - if the DITStructureRule does not exist

hasDITStructureRule

public boolean hasDITStructureRule(java.lang.String id)
Description copied from interface: DITStructureRuleRegistry
Checks to see if an dITStructureRule exists using the object identifier of the nameForm appended with the rule identifier of the DITStructureRule.

Specified by:
hasDITStructureRule in interface DITStructureRuleRegistry
Parameters:
id - the object identifier of the nameForm with the rule Id appended
Returns:
true if an dITStructureRule 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

getSchemaName

public java.lang.String getSchemaName(java.lang.Integer ruleId)
                               throws javax.naming.NamingException
Description copied from interface: DITStructureRuleRegistry
Gets the schema name for a DITStructureRule using the rule identifier.

Specified by:
getSchemaName in interface DITStructureRuleRegistry
Parameters:
ruleId - the rule identifier for the DITStructureRule
Returns:
the schema name for the DITStructureRule
Throws:
javax.naming.NamingException - if no such rule could be found

iterator

public java.util.Iterator<org.apache.directory.shared.ldap.schema.DITStructureRule> iterator()
Description copied from interface: DITStructureRuleRegistry
Lists all the DITStructureRules within this registry.

Specified by:
iterator in interface DITStructureRuleRegistry
Specified by:
iterator in interface SchemaObjectRegistry
Returns:
an Iterator over all the DITStructureRules within this registry

unregister

public void unregister(java.lang.Integer ruleId)
                throws javax.naming.NamingException
Description copied from interface: DITStructureRuleRegistry
Unregisters a DITStructureRule using it's rule identifier.

Specified by:
unregister in interface DITStructureRuleRegistry
Parameters:
ruleId - the rule identifier for the DITStructureRule to unregister
Throws:
javax.naming.NamingException - if no such DITStructureRule exists

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

hasDITStructureRule

public boolean hasDITStructureRule(java.lang.Integer ruleId)
Description copied from interface: DITStructureRuleRegistry
Checks to see if an dITStructureRule exists using the rule identifier.

Specified by:
hasDITStructureRule in interface DITStructureRuleRegistry
Parameters:
ruleId - the rule identifier for the DITStructureRule.
Returns:
true if an dITStructureRule definition exists for the id, false otherwise

lookup

public org.apache.directory.shared.ldap.schema.DITStructureRule lookup(java.lang.Integer ruleId)
                                                                throws javax.naming.NamingException
Description copied from interface: DITStructureRuleRegistry
Looks up an dITStructureRule by its unique Object IDentifier or by its name.

Specified by:
lookup in interface DITStructureRuleRegistry
Parameters:
ruleId - the rule identifier for the DITStructureRule
Returns:
the DITStructureRule instance for rule identifier
Throws:
javax.naming.NamingException - if the DITStructureRule does not exist


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