org.apache.directory.server.core.schema
Class GlobalSyntaxRegistry

java.lang.Object
  extended by org.apache.directory.server.core.schema.GlobalSyntaxRegistry
All Implemented Interfaces:
SyntaxRegistry

public class GlobalSyntaxRegistry
extends java.lang.Object
implements SyntaxRegistry

A plain old java object implementation of an SyntaxRegistry.

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

Constructor Summary
GlobalSyntaxRegistry(BootstrapSyntaxRegistry bootstrap, OidRegistry oidRegistry)
          Creates an empty BootstrapSyntaxRegistry.
 
Method Summary
 java.lang.String getSchemaName(java.lang.String id)
          Gets the name of the schema this schema object is associated with.
 boolean hasSyntax(java.lang.String id)
          Checks to see if a Syntax exists.
 java.util.Iterator list()
          Lists all the Syntaxes within this registry.
 Syntax lookup(java.lang.String id)
          Looks up a Syntax by its unique Object Identifier or by name.
 void register(java.lang.String schema, Syntax dITContentRule)
          Registers a Syntax with this registry.
 void setMonitor(SyntaxRegistryMonitor monitor)
          Sets the monitor that is to be notified via callback events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalSyntaxRegistry

public GlobalSyntaxRegistry(BootstrapSyntaxRegistry bootstrap,
                            OidRegistry oidRegistry)
Creates an empty BootstrapSyntaxRegistry.

Method Detail

setMonitor

public void setMonitor(SyntaxRegistryMonitor monitor)
Sets the monitor that is to be notified via callback events.

Parameters:
monitor - the new monitor to notify of notable events

register

public void register(java.lang.String schema,
                     Syntax dITContentRule)
              throws javax.naming.NamingException
Description copied from interface: SyntaxRegistry
Registers a Syntax with this registry.

Specified by:
register in interface SyntaxRegistry
Parameters:
schema - the name of the schema the Syntax is associated with
dITContentRule - the Syntax to register
Throws:
javax.naming.NamingException - if the syntax is already registered or the registration operation is not supported

lookup

public Syntax lookup(java.lang.String id)
              throws javax.naming.NamingException
Description copied from interface: SyntaxRegistry
Looks up a Syntax by its unique Object Identifier or by name.

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

hasSyntax

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

Specified by:
hasSyntax in interface SyntaxRegistry
Parameters:
id - the object identifier or name
Returns:
true if a Syntax 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: SyntaxRegistry
Gets the name of the schema this schema object is associated with.

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

list

public java.util.Iterator list()
Description copied from interface: SyntaxRegistry
Lists all the Syntaxes within this registry.

Specified by:
list in interface SyntaxRegistry
Returns:
an Iterator over all the Syntaxes within this registry