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

java.lang.Object
  extended by org.apache.directory.server.schema.registries.AbstractSchemaLoader
      extended by org.apache.directory.server.core.schema.PartitionSchemaLoader
All Implemented Interfaces:
SchemaLoader

public class PartitionSchemaLoader
extends AbstractSchemaLoader

A class that loads schemas from a partition.

Version:
$Rev$
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.server.schema.registries.AbstractSchemaLoader
listener
 
Constructor Summary
PartitionSchemaLoader(Partition partition, Registries registries)
           
 
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.
 java.util.Set<java.lang.String> getSchemaNames()
           
 java.util.Map<java.lang.String,Schema> getSchemas()
           
 java.util.Set<java.lang.String> listDependentSchemaNames(java.lang.String schemaName)
          Lists the names of the schemas that depend on the schema name provided.
 java.util.Set<java.lang.String> listEnabledDependentSchemaNames(java.lang.String schemaName)
          Lists the names of the enabled schemas that depend on the schema name provided.
 void load(Schema schema, Registries targetRegistries, boolean isDepLoad)
          SchemaLoader.load(Schema, Registries, boolean)
 void loadEnabled(Registries targetRegistries)
          Utility method to load all enabled schemas into this registry.
 void loadWithDependencies(java.util.Collection<Schema> schemas, Registries targetRegistries)
          Loads a collection of schemas.
 void loadWithDependencies(Schema schema, Registries registries)
          Loads a single schema at least and possibly it's dependencies.
 
Methods inherited from class org.apache.directory.server.schema.registries.AbstractSchemaLoader
loadDepsFirst, notifyListenerOrRegistries, setListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartitionSchemaLoader

public PartitionSchemaLoader(Partition partition,
                             Registries registries)
                      throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

loadEnabled

public void loadEnabled(Registries targetRegistries)
                 throws java.lang.Exception
Utility method to load all enabled schemas into this registry.

Parameters:
targetRegistries -
Throws:
javax.naming.NamingException
java.lang.Exception

listDependentSchemaNames

public java.util.Set<java.lang.String> listDependentSchemaNames(java.lang.String schemaName)
                                                         throws java.lang.Exception
Lists the names of the schemas that depend on the schema name provided.

Parameters:
schemaName - the name of the schema to find dependents for
Returns:
a set of schemas (String names) that depend on the schema
Throws:
javax.naming.NamingException - if there are problems searching the schema partition
java.lang.Exception

listEnabledDependentSchemaNames

public java.util.Set<java.lang.String> listEnabledDependentSchemaNames(java.lang.String schemaName)
                                                                throws java.lang.Exception
Lists the names of the enabled schemas that depend on the schema name provided.

Parameters:
schemaName - the name of the schema to find dependents for
Returns:
a set of enabled schemas (String names) that depend on the schema
Throws:
javax.naming.NamingException - if there are problems searching the schema partition
java.lang.Exception

getSchemas

public java.util.Map<java.lang.String,Schema> getSchemas()
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

getSchemaNames

public java.util.Set<java.lang.String> getSchemaNames()
                                               throws java.lang.Exception
Throws:
java.lang.Exception

getSchema

public Schema getSchema(java.lang.String schemaName)
                 throws java.lang.Exception
Description copied from interface: SchemaLoader
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:
java.lang.Exception

getSchema

public Schema getSchema(java.lang.String schemaName,
                        java.util.Properties schemaProperties)
                 throws java.lang.Exception
Description copied from interface: SchemaLoader
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:
java.lang.Exception

loadWithDependencies

public final void loadWithDependencies(java.util.Collection<Schema> schemas,
                                       Registries targetRegistries)
                                throws java.lang.Exception
Description copied from interface: SchemaLoader
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
targetRegistries - the registries to populate with these schemas
Throws:
java.lang.Exception

load

public final void load(Schema schema,
                       Registries targetRegistries,
                       boolean isDepLoad)
                throws java.lang.Exception
SchemaLoader.load(Schema, Registries, boolean)

Parameters:
schema - the schema to load
targetRegistries - the registries to populate with these schemas
isDepLoad - tells the loader if this load request is to satisfy a dependency
Throws:
java.lang.Exception

loadWithDependencies

public void loadWithDependencies(Schema schema,
                                 Registries registries)
                          throws java.lang.Exception
Description copied from interface: SchemaLoader
Loads a single schema at least and possibly it's dependencies.

Parameters:
schema - the schema to load
registries - the registries to populate with these schemas
Throws:
java.lang.Exception


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