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

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

public class DefaultSyntaxRegistry
extends java.lang.Object
implements SyntaxRegistry

A SyntaxRegistry service available during server startup when other resources like a syntax backing store is unavailable.

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

Constructor Summary
DefaultSyntaxRegistry(OidRegistry registry)
          Creates a DefaultSyntaxRegistry.
 
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<org.apache.directory.shared.ldap.schema.Syntax> iterator()
          Gets an iterator over the registered schema objects in the registry.
 org.apache.directory.shared.ldap.schema.Syntax lookup(java.lang.String id)
          Looks up a Syntax by its unique Object Identifier or by name.
 void register(org.apache.directory.shared.ldap.schema.Syntax syntax)
          Registers a Syntax 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

DefaultSyntaxRegistry

public DefaultSyntaxRegistry(OidRegistry registry)
Creates a DefaultSyntaxRegistry.

Parameters:
registry - 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.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.

register

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

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

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: 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.Syntax> iterator()
Description copied from interface: SchemaObjectRegistry
Gets an iterator over the registered schema objects in the registry.

Specified by:
iterator in interface SchemaObjectRegistry
Specified by:
iterator in interface SyntaxRegistry
Returns:
an Iterator of homogenious schema objects

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.