org.apache.directory.server.schema.registries
Interface SchemaLoader

All Known Implementing Classes:
AbstractSchemaLoader, BootstrapSchemaLoader, PartitionSchemaLoader

public interface SchemaLoader

Loads schemas into registres.

Version:
$Rev$
Author:
Apache Directory Project

Method Summary
 Schema getSchema(java.lang.String schemaName)
          Gets a schema object based on it's name.
 Schema getSchema(java.lang.String schemaName, java.util.Properties schemaProperties)
          Gets a schema object based on it's name and some properties.
 void load(Schema schema, Registries registries, boolean isDepLoad)
          Loads a single schema.
 void loadWithDependencies(java.util.Collection<Schema> schemas, Registries registries)
          Loads a collection of schemas.
 void loadWithDependencies(Schema schemas, Registries registries)
          Loads a single schema at least and possibly it's dependencies.
 void setListener(SchemaLoaderListener listener)
          Sets listener used to notify of newly loaded schemas.
 

Method Detail

setListener

void setListener(SchemaLoaderListener listener)
Sets listener used to notify of newly loaded schemas.

Parameters:
listener - the listener to notify (only one is enough for us)
'NOTE'
probably should have used the observer pattern here

getSchema

Schema getSchema(java.lang.String schemaName)
                 throws java.lang.Exception
Gets a schema object based on it's name.

Parameters:
schemaName - the name of the schema to load
Returns:
the Schema object associated with the name
Throws:
NamingException - if any problems while trying to find the associated Schema
java.lang.Exception

getSchema

Schema getSchema(java.lang.String schemaName,
                 java.util.Properties schemaProperties)
                 throws java.lang.Exception
Gets a schema object based on it's name and some properties.

Parameters:
schemaName - the name of the schema to load
schemaProperties - the properties associated with that schema to facilitate locating/loading it
Returns:
the Schema object associated with the name
Throws:
NamingException - if any problems while trying to find the associated Schema
java.lang.Exception

loadWithDependencies

void loadWithDependencies(java.util.Collection<Schema> schemas,
                          Registries registries)
                          throws java.lang.Exception
Loads a collection of schemas. A best effort should be made to load the dependended schemas that these schemas may rely on even if they are not included in the collection.

Parameters:
schemas - the collection of schemas to load
registries - the registries to populate with these schemas
Throws:
NamingException - if any kind of problems are encountered during the load
java.lang.Exception

loadWithDependencies

void loadWithDependencies(Schema schemas,
                          Registries registries)
                          throws java.lang.Exception
Loads a single schema at least and possibly it's dependencies.

Parameters:
schemas - the schema to load
registries - the registries to populate with these schemas
Throws:
NamingException - if any kind of problems are encountered during the load
java.lang.Exception

load

void load(Schema schema,
          Registries registries,
          boolean isDepLoad)
          throws java.lang.Exception
Loads a single schema. Do not try to resolve dependencies while implementing this method.

Parameters:
schema - the schema to load
registries - the registries to populate with these schemas
isDepLoad - tells the loader if this load request is to satisfy a dependency
Throws:
NamingException - if any kind of problems are encountered during the load
java.lang.Exception


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