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

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

public class DefaultMatchingRuleRegistry
extends java.lang.Object
implements MatchingRuleRegistry

A MatchingRuleRegistry service used to lookup matching rules by OID.

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

Constructor Summary
DefaultMatchingRuleRegistry(OidRegistry oidRegistry)
          Creates a DefaultMatchingRuleRegistry using existing MatchingRulees for lookups.
 
Method Summary
 java.lang.String getSchemaName(java.lang.String id)
          Gets the name of the schema this schema object is associated with.
 boolean hasMatchingRule(java.lang.String id)
          Checks to see if a MatchingRule exists.
 java.util.Iterator<org.apache.directory.shared.ldap.schema.MatchingRule> iterator()
          Gets an Iterator over the MatchingRules within this registry.
 org.apache.directory.shared.ldap.schema.MatchingRule lookup(java.lang.String id)
          Looks up a MatchingRule by its unique Object Identifier or by name.
 void register(org.apache.directory.shared.ldap.schema.MatchingRule matchingRule)
          Registers a MatchingRule 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

DefaultMatchingRuleRegistry

public DefaultMatchingRuleRegistry(OidRegistry oidRegistry)
Creates a DefaultMatchingRuleRegistry using existing MatchingRulees for lookups.

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

lookup

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

Specified by:
lookup in interface MatchingRuleRegistry
Parameters:
id - the object identifier or the name identifier
Returns:
the MatchingRule for the id
Throws:
javax.naming.NamingException - if there is a backing store failure or the MatchingRule does not exist.
See Also:
MatchingRuleRegistry.lookup(String)

register

public void register(org.apache.directory.shared.ldap.schema.MatchingRule matchingRule)
              throws javax.naming.NamingException
Description copied from interface: MatchingRuleRegistry
Registers a MatchingRule with this registry.

Specified by:
register in interface MatchingRuleRegistry
Parameters:
matchingRule - the MatchingRule to register
Throws:
javax.naming.NamingException - if the matchingRule is already registered or the registration operation is not supported
See Also:
MatchingRuleRegistry.register(MatchingRule)

hasMatchingRule

public boolean hasMatchingRule(java.lang.String id)
Description copied from interface: MatchingRuleRegistry
Checks to see if a MatchingRule exists. Backing store failures simply return false.

Specified by:
hasMatchingRule in interface MatchingRuleRegistry
Parameters:
id - the object identifier
Returns:
true if a MatchingRule definition exists for the oid, false otherwise
See Also:
MatchingRuleRegistry.hasMatchingRule(String)

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.MatchingRule> iterator()
Description copied from interface: MatchingRuleRegistry
Gets an Iterator over the MatchingRules within this registry.

Specified by:
iterator in interface MatchingRuleRegistry
Specified by:
iterator in interface SchemaObjectRegistry
Returns:
an iterator over all MatchingRules 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.