|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.schema.registries.AbstractSchemaLoader
public abstract class AbstractSchemaLoader
An abstract class with a utility method and setListener() implemented.
Field Summary | |
---|---|
protected SchemaLoaderListener |
listener
|
protected java.util.Map<java.lang.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 |
java.util.Collection<Schema> |
getAllEnabled()
|
java.util.Collection<Schema> |
getAllSchemas()
|
java.lang.Object |
getDao()
public List |
protected Schema |
getSchema(Entry entry)
|
Schema |
getSchema(java.lang.String schemaName)
Gets a schema object based on it's name. |
java.util.List<Entry> |
loadAttributeTypes(java.lang.String... schemaNames)
Build a list of AttributeTypes read from the underlying storage for a list of specific schema, using their name |
java.util.List<Entry> |
loadComparators(java.lang.String... schemaNames)
Build a list of Comparators read from the underlying storage for a list of specific schema, using their name |
java.util.List<Entry> |
loadDitContentRules(java.lang.String... schemaNames)
Build a list of DitContentRules read from the underlying storage for a list of specified schema names |
java.util.List<Entry> |
loadDitStructureRules(java.lang.String... schemaNames)
Build a list of DitStructureRules read from the underlying storage for a list of specified schema names |
java.util.List<Entry> |
loadMatchingRules(java.lang.String... schemaNames)
Build a list of MatchingRules read from the underlying storage for a list of specific schema, using their name |
java.util.List<Entry> |
loadMatchingRuleUses(java.lang.String... schemaNames)
Build a list of MatchingRuleUses read from the underlying storage for a list of specified schema names |
java.util.List<Entry> |
loadNameForms(java.lang.String... schemaNames)
Build a list of NameForms read from the underlying storage for a list of specified schema names |
java.util.List<Entry> |
loadNormalizers(java.lang.String... schemaNames)
Build a list of Normalizers read from the underlying storage for a list of specified schema names |
java.util.List<Entry> |
loadObjectClasses(java.lang.String... schemaNames)
Build a list of ObjectClasses read from the underlying storage for a list of specified schema names |
java.util.List<Entry> |
loadSyntaxCheckers(java.lang.String... schemaNames)
Build a list of SyntaxCheckers read from the underlying storage for a list of specified schema names |
java.util.List<Entry> |
loadSyntaxes(java.lang.String... schemaNames)
Build a list of Syntaxes read from the underlying storage for a list of specified schema names |
protected void |
notifyListenerOrRegistries(Schema schema,
Registries 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.shared.ldap.schema.registries.SchemaLoader |
---|
loadAttributeTypes, loadComparators, loadDitContentRules, loadDitStructureRules, loadMatchingRules, loadMatchingRuleUses, loadNameForms, loadNormalizers, loadObjectClasses, loadSyntaxCheckers, loadSyntaxes |
Field Detail |
---|
protected SchemaLoaderListener listener
protected final java.util.Map<java.lang.String,Schema> schemaMap
Constructor Detail |
---|
public AbstractSchemaLoader()
Method Detail |
---|
public void setListener(SchemaLoaderListener listener)
SchemaLoader
setListener
in interface SchemaLoader
listener
- the listener to notify (only one is enough for us)protected final void notifyListenerOrRegistries(Schema schema, Registries registries)
public final java.util.Collection<Schema> getAllEnabled() throws java.lang.Exception
getAllEnabled
in interface SchemaLoader
java.lang.Exception
- TODOpublic final java.util.Collection<Schema> getAllSchemas() throws java.lang.Exception
getAllSchemas
in interface SchemaLoader
java.lang.Exception
- TODOpublic Schema getSchema(java.lang.String schemaName)
getSchema
in interface SchemaLoader
schemaName
- the name of the schema to load
public void addSchema(Schema schema)
addSchema
in interface SchemaLoader
public void removeSchema(Schema schema)
removeSchema
in interface SchemaLoader
protected Schema getSchema(Entry entry) throws java.lang.Exception
java.lang.Exception
public java.lang.Object getDao()
registries
- The Registriesentry
- The LdifEntry containing the comparator descriptionschema
- The associated schemaregistries
- The Registriesentry
- The Entry containing the comparator descriptionschema
- The associated schemaregistries
- The Registriesentry
- The LdifEntry containing the SyntaxChecker descriptionschema
- The associated schemaregistries
- The Registriesentry
- The LdifEntry containing the Normalizer descriptionschema
- The associated schemaregistries
- The Registriesentry
- The LdifEntry containing the MatchingRule descriptionschema
- The associated schemaregistries
- The Registriesentry
- The LdifEntry containing the Syntax descriptionschema
- The associated schemaregistries
- The Registriesentry
- The LdifEntry containing the AttributeType descriptionschema
- The associated schemaregistries
- The Registriesentry
- The LdifEntry containing the MatchingRuleUse descriptionschema
- The associated schemaregistries
- The Registriesentry
- The LdifEntry containing the NameForm descriptionschema
- The associated schemaregistries
- The Registriesentry
- The LdifEntry containing the DitContentRule descriptionschema
- The associated schemaregistries
- The Registriesentry
- The LdifEntry containing the DitStructureRule descriptionschema
- The associated schemaregistries
- The Registriesentry
- The LdifEntry containing the ObjectClass descriptionschema
- The associated schemaregistries
- The Registriesentry
- The Entry containing the ObjectClass descriptionschema
- The associated schema
java.lang.Exception
- If the registering failed
protected LdapComparator> registerComparator( Registries registries, LdifEntry entry, Schema schema )
throws Exception
{
return registerComparator( registries, entry.getEntry(), schema );
}
/**
Register the comparator contained in the given Entry into the registries.
java.lang.Exception
- If the registering failed
protected LdapComparator> registerComparator( Registries registries, Entry entry, Schema schema )
throws Exception
{
LdapComparator> comparator =
factory.getLdapComparator( entry, registries, schema.getSchemaName() );
comparator.setOid( entry.get( MetaSchemaConstants.M_OID_AT ).getString() );
if ( registries.isRelaxed() )
{
if ( registries.acceptDisabled() )
{
registries.register( comparator );
}
else if ( schema.isEnabled() && comparator.isEnabled() )
{
registries.register( comparator );
}
}
else
{
if ( schema.isEnabled() && comparator.isEnabled() )
{
registries.register( comparator );
}
}
return comparator;
}
/**
Register the SyntaxChecker contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected SyntaxChecker registerSyntaxChecker( Registries registries, LdifEntry entry, Schema schema)
throws Exception
{
SyntaxChecker syntaxChecker =
factory.getSyntaxChecker( entry.getEntry(), registries, schema.getSchemaName() );
syntaxChecker.setOid( entry.get( MetaSchemaConstants.M_OID_AT ).getString() );
if ( registries.isRelaxed() )
{
if ( registries.acceptDisabled() )
{
registries.register( syntaxChecker );
}
else if ( schema.isEnabled() && syntaxChecker.isEnabled() )
{
registries.register( syntaxChecker );
}
}
else
{
if ( schema.isEnabled() && syntaxChecker.isEnabled() )
{
registries.register( syntaxChecker );
}
}
return syntaxChecker;
}
/**
Register the Normalizer contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected Normalizer registerNormalizer( Registries registries, LdifEntry entry, Schema schema)
throws Exception
{
Normalizer normalizer =
factory.getNormalizer( entry.getEntry(), registries, schema.getSchemaName() );
if ( registries.isRelaxed() )
{
if ( registries.acceptDisabled() )
{
registries.register( normalizer );
}
else if ( schema.isEnabled() && normalizer.isEnabled() )
{
registries.register( normalizer );
}
}
else
{
if ( schema.isEnabled() && normalizer.isEnabled() )
{
registries.register( normalizer );
}
}
return normalizer;
}
/**
Register the MatchingRule contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected MatchingRule registerMatchingRule( Registries registries, LdifEntry entry, Schema schema)
throws Exception
{
MatchingRule matchingRule = factory.getMatchingRule(
entry.getEntry(), registries, schema.getSchemaName() );
if ( registries.isRelaxed() )
{
if ( registries.acceptDisabled() )
{
registries.register( matchingRule );
}
else if ( schema.isEnabled() && matchingRule.isEnabled() )
{
registries.register( matchingRule );
}
}
else
{
if ( schema.isEnabled() && matchingRule.isEnabled() )
{
registries.register( matchingRule );
}
}
return matchingRule;
}
/**
Register the Syntax contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected LdapSyntax registerSyntax( Registries registries, LdifEntry entry, Schema schema)
throws Exception
{
LdapSyntax syntax = factory.getSyntax(
entry.getEntry(), registries, schema.getSchemaName() );
if ( registries.isRelaxed() )
{
if ( registries.acceptDisabled() )
{
registries.register( syntax );
}
else if ( schema.isEnabled() && syntax.isEnabled() )
{
registries.register( syntax );
}
}
else
{
if ( schema.isEnabled() && syntax.isEnabled() )
{
registries.register( syntax );
}
}
return syntax;
}
/**
Register the AttributeType contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected AttributeType registerAttributeType( Registries registries, LdifEntry entry, Schema schema )
throws Exception
{
AttributeType attributeType = factory.getAttributeType( entry.getEntry(), registries, schema.getSchemaName() );
if ( registries.isRelaxed() )
{
if ( registries.acceptDisabled() )
{
registries.register( attributeType );
}
else if ( schema.isEnabled() && attributeType.isEnabled() )
{
registries.register( attributeType );
}
}
else
{
if ( schema.isEnabled() && attributeType.isEnabled() )
{
registries.register( attributeType );
}
}
return attributeType;
}
/**
Register the MatchingRuleUse contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected MatchingRuleUse registerMatchingRuleUse( Registries registries, LdifEntry entry, Schema schema)
throws Exception
{
throw new NotImplementedException( "Need to implement factory " +
"method for creating a MatchingRuleUse" );
}
/**
Register the NameForm contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected NameForm registerNameForm( Registries registries, LdifEntry entry, Schema schema)
throws Exception
{
throw new NotImplementedException( "Need to implement factory " +
"method for creating a NameForm" );
}
/**
Register the DitContentRule contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected DITContentRule registerDitContentRule( Registries registries, LdifEntry entry, Schema schema)
throws Exception
{
throw new NotImplementedException( "Need to implement factory " +
"method for creating a DitContentRule" );
}
/**
Register the DitStructureRule contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected DITStructureRule registerDitStructureRule( Registries registries, LdifEntry entry, Schema schema)
throws Exception
{
throw new NotImplementedException( "Need to implement factory " +
"method for creating a DitStructureRule" );
}
/**
Register the ObjectClass contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected ObjectClass registerObjectClass( Registries registries, LdifEntry entry, Schema schema)
throws Exception
{
return registerObjectClass( registries, entry.getEntry(), schema );
}
/**
Register the ObjectClass contained in the given LdifEntry into the registries.
java.lang.Exception
- If the registering failed
protected ObjectClass registerObjectClass( Registries registries, Entry entry, Schema schema)
throws Exception
{
ObjectClass objectClass = factory.getObjectClass( entry, registries, schema.getSchemaName() );
if ( registries.isRelaxed() )
{
if ( registries.acceptDisabled() )
{
registries.register( objectClass );
}
else if ( schema.isEnabled() && objectClass.isEnabled() )
{
registries.register( objectClass );
}
}
else
{
if ( schema.isEnabled() && objectClass.isEnabled() )
{
registries.register( objectClass );
}
}
return objectClass;
}
public EntityFactory getFactory()
{
return factory;
}public java.util.List<Entry> loadAttributeTypes(java.lang.String... schemaNames) throws java.lang.Exception
loadAttributeTypes
in interface SchemaLoader
schemaNames
- the schema names from which AttributeTypes are loaded
java.lang.Exception
- if there are failures accessing AttributeType informationpublic java.util.List<Entry> loadComparators(java.lang.String... schemaNames) throws java.lang.Exception
loadComparators
in interface SchemaLoader
schemaNames
- the schema names from which Comparators are loaded
java.lang.Exception
- if there are failures accessing Comparator informationpublic java.util.List<Entry> loadDitContentRules(java.lang.String... schemaNames) throws java.lang.Exception
loadDitContentRules
in interface SchemaLoader
java.lang.Exception
- if there are failures accessing DitContentRule informationpublic java.util.List<Entry> loadDitStructureRules(java.lang.String... schemaNames) throws java.lang.Exception
loadDitStructureRules
in interface SchemaLoader
java.lang.Exception
- if there are failures accessing DitStructureRule informationpublic java.util.List<Entry> loadMatchingRules(java.lang.String... schemaNames) throws java.lang.Exception
loadMatchingRules
in interface SchemaLoader
schemaNames
- the schema names from which MatchingRules are loaded
java.lang.Exception
- if there are failures accessing MatchingRule informationpublic java.util.List<Entry> loadMatchingRuleUses(java.lang.String... schemaNames) throws java.lang.Exception
loadMatchingRuleUses
in interface SchemaLoader
java.lang.Exception
- if there are failures accessing MatchingRuleUses informationpublic java.util.List<Entry> loadNameForms(java.lang.String... schemaNames) throws java.lang.Exception
loadNameForms
in interface SchemaLoader
java.lang.Exception
- if there are failures accessing NameForms informationpublic java.util.List<Entry> loadNormalizers(java.lang.String... schemaNames) throws java.lang.Exception
loadNormalizers
in interface SchemaLoader
schemaNames
- the schema names from which Normalizers are loaded
java.lang.Exception
- if there are failures accessing Normalizer informationpublic java.util.List<Entry> loadObjectClasses(java.lang.String... schemaNames) throws java.lang.Exception
loadObjectClasses
in interface SchemaLoader
schemaNames
- the schema names from which ObjectClasses are loaded
java.lang.Exception
- if there are failures accessing ObjectClasses informationpublic java.util.List<Entry> loadSyntaxes(java.lang.String... schemaNames) throws java.lang.Exception
loadSyntaxes
in interface SchemaLoader
schemaNames
- the schema names from which Syntaxes are loaded
java.lang.Exception
- if there are failures accessing Syntax informationpublic java.util.List<Entry> loadSyntaxCheckers(java.lang.String... schemaNames) throws java.lang.Exception
loadSyntaxCheckers
in interface SchemaLoader
java.lang.Exception
- if there are failures accessing SyntaxChecker information
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |