org.apache.directory.api.ldap.model.schema.registries
Class AbstractSchemaLoader

java.lang.Object
  extended by org.apache.directory.api.ldap.model.schema.registries.AbstractSchemaLoader
All Implemented Interfaces:
SchemaLoader

public abstract class AbstractSchemaLoader
extends Object
implements SchemaLoader

An abstract class with a utility method and setListener() implemented.

Author:
Apache Directory Project

Field Summary
protected  SchemaLoaderListener listener
          The listener.
protected  Map<String,Schema> schemaMap
          A map of all available schema names to schema objects.
 
Constructor Summary
AbstractSchemaLoader()
           
 
Method Summary
 void addSchema(Schema schema)
          Add a new schema to the schema's list
 Collection<Schema> getAllEnabled()
          
 Collection<Schema> getAllSchemas()
          
 Object getDao()
           
protected  Schema getSchema(Entry entry)
          Gets the schema.
 Schema getSchema(String schemaName)
          Gets a schema object based on it's name.
 List<Entry> loadAttributeTypes(String... schemaNames)
          Build a list of AttributeTypes read from the underlying storage for a list of specific schema, using their name
 List<Entry> loadComparators(String... schemaNames)
          Build a list of Comparators read from the underlying storage for a list of specific schema, using their name
 List<Entry> loadDitContentRules(String... schemaNames)
          Build a list of DitContentRules read from the underlying storage for a list of specified schema names
 List<Entry> loadDitStructureRules(String... schemaNames)
          Build a list of DitStructureRules read from the underlying storage for a list of specified schema names
 List<Entry> loadMatchingRules(String... schemaNames)
          Build a list of MatchingRules read from the underlying storage for a list of specific schema, using their name
 List<Entry> loadMatchingRuleUses(String... schemaNames)
          Build a list of MatchingRuleUses read from the underlying storage for a list of specified schema names
 List<Entry> loadNameForms(String... schemaNames)
          Build a list of NameForms read from the underlying storage for a list of specified schema names
 List<Entry> loadNormalizers(String... schemaNames)
          Build a list of Normalizers read from the underlying storage for a list of specified schema names
 List<Entry> loadObjectClasses(String... schemaNames)
          Build a list of ObjectClasses read from the underlying storage for a list of specified schema names
 List<Entry> loadSyntaxCheckers(String... schemaNames)
          Build a list of SyntaxCheckers read from the underlying storage for a list of specified schema names
 List<Entry> loadSyntaxes(String... schemaNames)
          Build a list of Syntaxes read from the underlying storage for a list of specified schema names
protected  void notifyListenerOrRegistries(Schema schema, SchemaManager schemaManager)
          Notify listener or registries.
 void removeSchema(Schema schema)
          Remove a schema from the schema's list
 void setListener(SchemaLoaderListener listener)
          Sets listener used to notify of newly loaded schemas.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.directory.api.ldap.model.schema.registries.SchemaLoader
loadAttributeTypes, loadComparators, loadDitContentRules, loadDitStructureRules, loadMatchingRules, loadMatchingRuleUses, loadNameForms, loadNormalizers, loadObjectClasses, loadSyntaxCheckers, loadSyntaxes
 

Field Detail

listener

protected SchemaLoaderListener listener
The listener.


schemaMap

protected final Map<String,Schema> schemaMap
A map of all available schema names to schema objects. This map is populated when this class is created with all the schemas present in the LDIF based schema repository.

Constructor Detail

AbstractSchemaLoader

public AbstractSchemaLoader()
Method Detail

setListener

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

Specified by:
setListener in interface SchemaLoader
Parameters:
listener - the listener to notify (only one is enough for us)

notifyListenerOrRegistries

protected final void notifyListenerOrRegistries(Schema schema,
                                                SchemaManager schemaManager)
Notify listener or registries.

Parameters:
schema - the schema
registries - the registries

getAllEnabled

public final Collection<Schema> getAllEnabled()
                                       throws Exception

Specified by:
getAllEnabled in interface SchemaLoader
Returns:
the list of enabled schemas
Throws:
Exception - TODO

getAllSchemas

public final Collection<Schema> getAllSchemas()
                                       throws Exception

Specified by:
getAllSchemas in interface SchemaLoader
Returns:
the list of all schemas
Throws:
Exception - TODO

getSchema

public Schema getSchema(String schemaName)
Gets a schema object based on it's name.

Specified by:
getSchema in interface SchemaLoader
Parameters:
schemaName - the name of the schema to load
Returns:
the Schema object associated with the name

addSchema

public void addSchema(Schema schema)
Add a new schema to the schema's list

Specified by:
addSchema in interface SchemaLoader

removeSchema

public void removeSchema(Schema schema)
Remove a schema from the schema's list

Specified by:
removeSchema in interface SchemaLoader

getSchema

protected Schema getSchema(Entry entry)
                    throws Exception
Gets the schema.

Parameters:
entry - the entry
Returns:
the schema
Throws:
Exception - the exception

getDao

public Object getDao()

loadAttributeTypes

public List<Entry> loadAttributeTypes(String... schemaNames)
                               throws Exception
Build a list of AttributeTypes read from the underlying storage for a list of specific schema, using their name

Specified by:
loadAttributeTypes in interface SchemaLoader
Parameters:
schemaNames - the schema names from which AttributeTypes are loaded
Throws:
Exception - if there are failures accessing AttributeType information

loadComparators

public List<Entry> loadComparators(String... schemaNames)
                            throws Exception
Build a list of Comparators read from the underlying storage for a list of specific schema, using their name

Specified by:
loadComparators in interface SchemaLoader
Parameters:
schemaNames - the schema names from which Comparators are loaded
Throws:
Exception - if there are failures accessing Comparator information

loadDitContentRules

public List<Entry> loadDitContentRules(String... schemaNames)
                                throws Exception
Build a list of DitContentRules read from the underlying storage for a list of specified schema names

Specified by:
loadDitContentRules in interface SchemaLoader
Parameters:
schemaNames - the schema names from which DitContentRules are loaded
Throws:
Exception - if there are failures accessing DitContentRule information

loadDitStructureRules

public List<Entry> loadDitStructureRules(String... schemaNames)
                                  throws Exception
Build a list of DitStructureRules read from the underlying storage for a list of specified schema names

Specified by:
loadDitStructureRules in interface SchemaLoader
Parameters:
schemaNames - the schema names from which DitStructureRules are loaded
Throws:
Exception - if there are failures accessing DitStructureRule information

loadMatchingRules

public List<Entry> loadMatchingRules(String... schemaNames)
                              throws Exception
Build a list of MatchingRules read from the underlying storage for a list of specific schema, using their name

Specified by:
loadMatchingRules in interface SchemaLoader
Parameters:
schemaNames - the schema names from which MatchingRules are loaded
Throws:
Exception - if there are failures accessing MatchingRule information

loadMatchingRuleUses

public List<Entry> loadMatchingRuleUses(String... schemaNames)
                                 throws Exception
Build a list of MatchingRuleUses read from the underlying storage for a list of specified schema names

Specified by:
loadMatchingRuleUses in interface SchemaLoader
Parameters:
schemaNames - the schema names from which MatchingRuleUses are loaded
Throws:
Exception - if there are failures accessing MatchingRuleUses information

loadNameForms

public List<Entry> loadNameForms(String... schemaNames)
                          throws Exception
Build a list of NameForms read from the underlying storage for a list of specified schema names

Specified by:
loadNameForms in interface SchemaLoader
Parameters:
schemaNames - the schema names from which NameForms are loaded
Throws:
Exception - if there are failures accessing NameForms information

loadNormalizers

public List<Entry> loadNormalizers(String... schemaNames)
                            throws Exception
Build a list of Normalizers read from the underlying storage for a list of specified schema names

Specified by:
loadNormalizers in interface SchemaLoader
Parameters:
schemaNames - the schema names from which Normalizers are loaded
Throws:
Exception - if there are failures accessing Normalizer information

loadObjectClasses

public List<Entry> loadObjectClasses(String... schemaNames)
                              throws Exception
Build a list of ObjectClasses read from the underlying storage for a list of specified schema names

Specified by:
loadObjectClasses in interface SchemaLoader
Parameters:
schemaNames - the schema names from which ObjectClasses are loaded
Throws:
Exception - if there are failures accessing ObjectClasses information

loadSyntaxes

public List<Entry> loadSyntaxes(String... schemaNames)
                         throws Exception
Build a list of Syntaxes read from the underlying storage for a list of specified schema names

Specified by:
loadSyntaxes in interface SchemaLoader
Parameters:
schemaNames - the schema names from which Syntaxes are loaded
Throws:
Exception - if there are failures accessing Syntax information

loadSyntaxCheckers

public List<Entry> loadSyntaxCheckers(String... schemaNames)
                               throws Exception
Build a list of SyntaxCheckers read from the underlying storage for a list of specified schema names

Specified by:
loadSyntaxCheckers in interface SchemaLoader
Parameters:
schemaNames - the schema names from which SyntaxCheckers are loaded
Throws:
Exception - if there are failures accessing SyntaxChecker information


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.