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

java.lang.Object
  extended by org.apache.directory.server.schema.registries.DefaultComparatorRegistry
All Implemented Interfaces:
ComparatorRegistry

public class DefaultComparatorRegistry
extends java.lang.Object
implements ComparatorRegistry

A simple POJO implementation of the ComparatorRegistry service interface.

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

Constructor Summary
DefaultComparatorRegistry()
          Creates a DefaultComparatorRegistry by initializing the map and the montior.
 
Method Summary
 java.util.Iterator<org.apache.directory.shared.ldap.schema.syntax.ComparatorDescription> comparatorDescriptionIterator()
          Iterates over the numeric OID strings of this registry.
 java.lang.String getSchemaName(java.lang.String oid)
          Gets the name of the schema this schema object is associated with.
 boolean hasComparator(java.lang.String oid)
          Checks to see if a Comparator exists.
 java.util.Comparator lookup(java.lang.String oid)
          Looks up a Comparator by its unique Object Identifier.
 java.util.Iterator<java.lang.String> oidIterator()
          Iterates over the numeric OID strings of this registry.
 void register(org.apache.directory.shared.ldap.schema.syntax.ComparatorDescription description, java.util.Comparator comparator)
          Registers a Comparator with this registry.
 void renameSchema(java.lang.String originalSchemaName, java.lang.String newSchemaName)
          Renames the schemaName associated with entities within this registry to a new schema name.
 void unregister(java.lang.String oid)
          Removes a registered comparator from this registry.
 void unregisterSchemaElements(java.lang.String schemaName)
          Unregisters comparators from this registry associated with a schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComparatorRegistry

public DefaultComparatorRegistry()
Creates a DefaultComparatorRegistry by initializing the map and the montior.

Method Detail

register

public void register(org.apache.directory.shared.ldap.schema.syntax.ComparatorDescription description,
                     java.util.Comparator comparator)
              throws javax.naming.NamingException
Description copied from interface: ComparatorRegistry
Registers a Comparator with this registry.

Specified by:
register in interface ComparatorRegistry
Parameters:
description - the comparatorDescription for the comparator to register
comparator - the Comparator to register
Throws:
javax.naming.NamingException - if the Comparator is already registered or the registration operation is not supported

lookup

public java.util.Comparator lookup(java.lang.String oid)
                            throws javax.naming.NamingException
Description copied from interface: ComparatorRegistry
Looks up a Comparator by its unique Object Identifier.

Specified by:
lookup in interface ComparatorRegistry
Parameters:
oid - the object identifier
Returns:
the Comparator for the oid
Throws:
javax.naming.NamingException - if there is a backing store failure or the Comparator does not exist.

hasComparator

public boolean hasComparator(java.lang.String oid)
Description copied from interface: ComparatorRegistry
Checks to see if a Comparator exists. Backing store failures simply return false.

Specified by:
hasComparator in interface ComparatorRegistry
Parameters:
oid - the object identifier
Returns:
true if a Comparator definition exists for the oid, false otherwise

getSchemaName

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

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

oidIterator

public java.util.Iterator<java.lang.String> oidIterator()
Description copied from interface: ComparatorRegistry
Iterates over the numeric OID strings of this registry.

Specified by:
oidIterator in interface ComparatorRegistry
Returns:
Iterator of numeric OID strings

unregister

public void unregister(java.lang.String oid)
                throws javax.naming.NamingException
Description copied from interface: ComparatorRegistry
Removes a registered comparator from this registry.

Specified by:
unregister in interface ComparatorRegistry
Parameters:
oid - the numeric oid of the comparator to remove.
Throws:
javax.naming.NamingException - if the oid is not a numeric id

unregisterSchemaElements

public void unregisterSchemaElements(java.lang.String schemaName)
Description copied from interface: ComparatorRegistry
Unregisters comparators from this registry associated with a schema.

Specified by:
unregisterSchemaElements in interface ComparatorRegistry
Parameters:
schemaName - the name of the schema whose comparators are removed from this registry

renameSchema

public void renameSchema(java.lang.String originalSchemaName,
                         java.lang.String newSchemaName)
Description copied from interface: ComparatorRegistry
Renames the schemaName associated with entities within this registry to a new schema name.

Specified by:
renameSchema in interface ComparatorRegistry
Parameters:
originalSchemaName - the original schema name
newSchemaName - the new name to give to the schema

comparatorDescriptionIterator

public java.util.Iterator<org.apache.directory.shared.ldap.schema.syntax.ComparatorDescription> comparatorDescriptionIterator()
Description copied from interface: ComparatorRegistry
Iterates over the numeric OID strings of this registry.

Specified by:
comparatorDescriptionIterator in interface ComparatorRegistry
Returns:
Iterator of numeric OID strings


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