org.apache.directory.server.core.schema.bootstrap
Class BootstrapComparatorRegistry

java.lang.Object
  extended by org.apache.directory.server.core.schema.bootstrap.BootstrapComparatorRegistry
All Implemented Interfaces:
ComparatorRegistry

public class BootstrapComparatorRegistry
extends java.lang.Object
implements ComparatorRegistry

A simple POJO implementation of the ComparatorRegistry service interface.

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

Constructor Summary
BootstrapComparatorRegistry()
          Creates a default ComparatorRegistry by initializing the map and the montior.
 
Method Summary
 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.
 void register(java.lang.String schema, java.lang.String oid, java.util.Comparator comparator)
          Registers a Comparator with this registry.
 void setMonitor(ComparatorRegistryMonitor monitor)
          Sets the monitor used by this registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BootstrapComparatorRegistry

public BootstrapComparatorRegistry()
Creates a default ComparatorRegistry by initializing the map and the montior.

Method Detail

setMonitor

public void setMonitor(ComparatorRegistryMonitor monitor)
Sets the monitor used by this registry.

Parameters:
monitor - the monitor to set for registry event callbacks

register

public void register(java.lang.String schema,
                     java.lang.String oid,
                     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:
schema - the name of the schema the comparator is associated with
oid - the object identifier
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


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