public class DefaultSchemaManager extends Object implements SchemaManager
Modifier and Type | Field and Description |
---|---|
protected EntityFactory |
factory
the factory that generates respective SchemaObjects from LDIF entries
|
static boolean |
RELAXED |
static boolean |
STRICT
Two flags for RELAXED and STRUCT
|
Constructor and Description |
---|
DefaultSchemaManager(SchemaLoader loader)
Creates a new instance of DefaultSchemaManager with the default schema schemaLoader
|
DefaultSchemaManager(SchemaLoader loader,
DN namingContext)
Creates a new instance of DefaultSchemaManager, for a specific
naming context
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(SchemaObject schemaObject)
Registers a new SchemaObject.
|
boolean |
delete(SchemaObject schemaObject)
Unregisters a new SchemaObject.
|
boolean |
disable(Schema... schemas)
Disables a set of Schemas, and returns true if all the schema have been
disabled, with all the dependent schemas, and if the registries is
still consistent.
|
boolean |
disable(String... schemaNames)
Disables a set of Schemas, and returns true if all the schema have been
disabled, with all the dependent schemas, and if the registries is
still consistent.
|
boolean |
disabledRelaxed(Schema... schemas)
Disables a set of Schemas, and returns true if all the schema have been
disabled, with all the dependent schemas.
|
boolean |
disabledRelaxed(String... schemas)
Disables a set of Schemas, and returns true if all the schema have been
disabled, with all the dependent schemas.
|
boolean |
enable(Schema... schemas)
Enables a set of Schemas, and returns true if all the schema have been
enabled, with all the dependent schemas, and if the registries is
still consistent.
|
boolean |
enable(String... schemaNames)
Enables a set of Schemas, and returns true if all the schema have been
enabled, with all the dependent schemas, and if the registries is
still consistent.
|
boolean |
enableRelaxed(Schema... schemas)
Enables a set of Schemas, and returns true if all the schema have been
enabled, with all the dependent schemas.
|
boolean |
enableRelaxed(String... schemas)
Enables a set of Schemas, and returns true if all the schema have been
enabled, with all the dependent schemas.
|
AttributeTypeRegistry |
getAttributeTypeRegistry()
Get an immutable reference on the AttributeType registry
|
ComparatorRegistry |
getComparatorRegistry()
Get an immutable reference on the Comparator registry
|
List<Schema> |
getDisabled() |
DITContentRuleRegistry |
getDITContentRuleRegistry()
Get an immutable reference on the DITContentRule registry
|
DITStructureRuleRegistry |
getDITStructureRuleRegistry()
Get an immutable reference on the DITStructureRule registry
|
List<Schema> |
getEnabled() |
List<Throwable> |
getErrors() |
OidRegistry |
getGlobalOidRegistry()
Returns a reference to the global OidRegistry
|
LdapSyntaxRegistry |
getLdapSyntaxRegistry()
Get an immutable reference on the LdapSyntax registry
|
Schema |
getLoadedSchema(String schemaName)
Gets a schema that has been loaded into these Registries.
|
SchemaLoader |
getLoader() |
MatchingRuleRegistry |
getMatchingRuleRegistry()
Get an immutable reference on the MatchingRule registry
|
MatchingRuleUseRegistry |
getMatchingRuleUseRegistry()
Get an immutable reference on the MatchingRuleUse registry
|
NameFormRegistry |
getNameFormRegistry()
Get an immutable reference on the NameForm registry
|
DN |
getNamingContext() |
Map<String,OidNormalizer> |
getNormalizerMapping()
Get an immutable reference on the Normalizer mapping
|
NormalizerRegistry |
getNormalizerRegistry()
Get an immutable reference on the Normalizer registry
|
ObjectClassRegistry |
getObjectClassRegistry()
Get an immutable reference on the ObjectClass registry
|
Registries |
getRegistries() |
SyntaxCheckerRegistry |
getSyntaxCheckerRegistry()
Get an immutable reference on the SyntaxChecker registry
|
void |
initialize()
Initializes the SchemaService
|
boolean |
isDisabled(Schema schema)
Tells if the given Schema is disabled
|
boolean |
isDisabled(String schemaName)
Tells if the given Schema is disabled
|
boolean |
isDisabledAccepted() |
boolean |
isEnabled(Schema schema)
Tells if the given Schema is enabled
|
boolean |
isEnabled(String schemaName)
Tells if the given Schema is enabled
|
boolean |
isRelaxed()
Tells if the SchemaManager is permissive or if it must be checked
against inconsistencies.
|
boolean |
isSchemaLoaded(String schemaName)
Tells if the specific schema is loaded
|
boolean |
isStrict()
Tells if the SchemaManager is strict.
|
Set<String> |
listDependentSchemaNames(String schemaName)
Get the list of Schema names which has the given schema name as a dependence
|
boolean |
load(Schema... schemas)
Load some Schemas into the registries.
|
boolean |
load(String... schemaNames)
Load some Schemas into the registries.
|
boolean |
loadAllEnabled()
Load all the enabled schema into the Registries.
|
boolean |
loadAllEnabledRelaxed()
Load all the enabled schema into the Registries.
|
boolean |
loadDisabled(Schema... schemas)
Load Schemas into the Registries, even if they are disabled.
|
boolean |
loadDisabled(String... schemaNames)
Load Schemas into the Registries, even if they are disabled.
|
boolean |
loadRelaxed(Schema... schemas)
Load Schemas into the registries, even if there are some errors in the schemas.
|
boolean |
loadRelaxed(String... schemaNames)
Load Schemas into the registries, even if there are some errors in the schemas.
|
boolean |
loadWithDeps(Schema... schemas)
Load some Schemas into the registries, and loads all of the schemas they depend
on.
|
boolean |
loadWithDeps(String... schemas)
Load some Schemas into the registries, and loads all of the schemas they depend
on.
|
boolean |
loadWithDepsRelaxed(Schema... schemas)
Load some Schemas into the registries, and loads all of the schemas they depend
on.
|
boolean |
loadWithDepsRelaxed(String... schemas)
Load some Schemas into the registries, and loads all of the schemas they depend
on.
|
AttributeType |
lookupAttributeTypeRegistry(String oid)
Lookup for an AttributeType in the AttributeType registry
|
LdapComparator<?> |
lookupComparatorRegistry(String oid)
Lookup for a Comparator in the Comparator registry
|
LdapSyntax |
lookupLdapSyntaxRegistry(String oid)
Lookup for an LdapSyntax in the LdapSyntax registry
|
MatchingRule |
lookupMatchingRuleRegistry(String oid)
Lookup for a MatchingRule in the MatchingRule registry
|
Normalizer |
lookupNormalizerRegistry(String oid)
Lookup for a Normalizer in the Normalizer registry
|
ObjectClass |
lookupObjectClassRegistry(String oid)
Lookup for a ObjectClass in the ObjectClass registry
|
SyntaxChecker |
lookupSyntaxCheckerRegistry(String oid)
Lookup for a SyntaxChecker in the SyntaxChecker registry
|
void |
setRegistries(Registries registries)
Associate a new Registries to the SchemaManager
|
void |
setRelaxed()
Change the SchemaManager to a relaxed mode, where invalid SchemaObjects
can be registered.
|
void |
setSchemaLoader(SchemaLoader schemaLoader)
Associate a Schema loader to this SchemaManager
|
void |
setStrict()
Change the SchemaManager to a strict mode, where invalid SchemaObjects
cannot be registered.
|
boolean |
unload(Schema... schemas)
Unload the given set of Schemas
|
boolean |
unload(String... schemaNames)
Unload the given set of Schemas
|
SchemaObject |
unregisterAttributeType(String attributeTypeOid)
Removes the registered attributeType from the attributeTypeRegistry
|
SchemaObject |
unregisterComparator(String comparatorOid)
Removes the registered Comparator from the ComparatorRegistry
|
SchemaObject |
unregisterDitControlRule(String ditControlRuleOid)
Removes the registered DitControlRule from the DitControlRuleRegistry
|
SchemaObject |
unregisterDitStructureRule(String ditStructureRuleOid)
Removes the registered DitStructureRule from the DitStructureRuleRegistry
|
SchemaObject |
unregisterLdapSyntax(String ldapSyntaxOid)
Removes the registered LdapSyntax from the LdapSyntaxRegistry
|
SchemaObject |
unregisterMatchingRule(String matchingRuleOid)
Removes the registered MatchingRule from the MatchingRuleRegistry
|
SchemaObject |
unregisterMatchingRuleUse(String matchingRuleUseOid)
Removes the registered MatchingRuleUse from the MatchingRuleUseRegistry
|
SchemaObject |
unregisterNameForm(String nameFormOid)
Removes the registered NameForm from the NameFormRegistry
|
SchemaObject |
unregisterNormalizer(String normalizerOid)
Removes the registered Normalizer from the NormalizerRegistry
|
SchemaObject |
unregisterObjectClass(String objectClassOid)
Removes the registered ObjectClass from the ObjectClassRegistry
|
SchemaObject |
unregisterSyntaxChecker(String syntaxCheckerOid)
Removes the registered SyntaxChecker from the SyntaxCheckerRegistry
|
boolean |
verify(Schema... schemas)
Check that the Schemas are consistent regarding the current Registries.
|
boolean |
verify(String... schemas)
Check that the Schemas are consistent regarding the current Registries.
|
protected final EntityFactory factory
public static final boolean STRICT
public static final boolean RELAXED
public DefaultSchemaManager(SchemaLoader loader) throws Exception
loader
- The schema loader to useException
public DefaultSchemaManager(SchemaLoader loader, DN namingContext) throws Exception
loader
- The schema loader to usenamingContext
- The associated NamingContextException
public boolean disable(Schema... schemas) throws Exception
disable
in interface SchemaManager
schemas
- The list of schemas to disableException
public boolean disable(String... schemaNames) throws Exception
disable
in interface SchemaManager
schemaNames
- The list of schema names to disableException
public boolean disabledRelaxed(Schema... schemas)
disabledRelaxed
in interface SchemaManager
schemas
- The list of schemas to disablepublic boolean disabledRelaxed(String... schemas)
disabledRelaxed
in interface SchemaManager
schemas
- The list of schema names to disablepublic List<Schema> getDisabled()
getDisabled
in interface SchemaManager
public boolean enable(Schema... schemas) throws Exception
enable
in interface SchemaManager
schemas
- The list of schemas to enableException
public boolean enable(String... schemaNames) throws Exception
enable
in interface SchemaManager
schemaNames
- The list of schema name to enableException
public boolean enableRelaxed(Schema... schemas)
enableRelaxed
in interface SchemaManager
schemas
- The list of schemas to enablepublic boolean enableRelaxed(String... schemas)
enableRelaxed
in interface SchemaManager
schemas
- The list of schema names to enablepublic List<Schema> getEnabled()
getEnabled
in interface SchemaManager
public List<Throwable> getErrors()
getErrors
in interface SchemaManager
public Registries getRegistries()
getRegistries
in interface SchemaManager
public boolean isDisabledAccepted()
public boolean load(Schema... schemas) throws Exception
SchemaManager.getErrors()
method will contain themload
in interface SchemaManager
schemas
- the Schemas to loadException
- @TODOpublic boolean load(String... schemaNames) throws Exception
SchemaManager.getErrors()
method will contain themload
in interface SchemaManager
schemaNames
- the Schemas' name to loadException
- @TODOpublic boolean loadAllEnabled() throws Exception
loadAllEnabled
in interface SchemaManager
Exception
- @TODOpublic boolean loadAllEnabledRelaxed() throws Exception
loadAllEnabledRelaxed
in interface SchemaManager
Exception
- @TODOpublic boolean loadDisabled(Schema... schemas) throws Exception
SchemaManager.getErrors()
method will contain themloadDisabled
in interface SchemaManager
schemas
- The Schemas to loadException
- @TODOpublic boolean loadDisabled(String... schemaNames) throws Exception
SchemaManager.getErrors()
method will contain themloadDisabled
in interface SchemaManager
schemaNames
- The Schemas' name to loadException
- @TODOpublic boolean loadRelaxed(Schema... schemas) throws Exception
SchemaManager.getErrors()
method will contain themloadRelaxed
in interface SchemaManager
schemas
- the Schemas to load, if enabledException
- @TODOpublic boolean loadRelaxed(String... schemaNames) throws Exception
SchemaManager.getErrors()
method will contain themloadRelaxed
in interface SchemaManager
schemaNames
- the Schemas' name to load, if enabledException
- @TODOpublic boolean loadWithDeps(Schema... schemas) throws Exception
SchemaManager.getErrors()
method will contain themloadWithDeps
in interface SchemaManager
schemas
- the Schemas to loadException
- @TODOpublic boolean loadWithDeps(String... schemas) throws Exception
SchemaManager.getErrors()
method will contain themloadWithDeps
in interface SchemaManager
schemas
- the Schemas' name to loadException
- @TODOpublic boolean loadWithDepsRelaxed(Schema... schemas) throws Exception
SchemaManager.getErrors()
method will contain themloadWithDepsRelaxed
in interface SchemaManager
schemas
- the Schemas to loadException
- @TODOpublic boolean loadWithDepsRelaxed(String... schemas) throws Exception
SchemaManager.getErrors()
method will contain themloadWithDepsRelaxed
in interface SchemaManager
schemas
- the Schemas' name to loadException
- @TODOpublic void setRegistries(Registries registries)
setRegistries
in interface SchemaManager
registries
- The new Registriespublic boolean unload(Schema... schemas) throws Exception
unload
in interface SchemaManager
schemas
- The list of Schema to unloadException
public boolean unload(String... schemaNames) throws Exception
unload
in interface SchemaManager
schemaNames
- The list of Schema to unloadException
public boolean verify(Schema... schemas) throws Exception
verify
in interface SchemaManager
schemas
- The schemas to checkException
- if something went wrongpublic boolean verify(String... schemas) throws Exception
verify
in interface SchemaManager
schemas
- The schema names to checkException
- if something went wrongpublic void setSchemaLoader(SchemaLoader schemaLoader)
setSchemaLoader
in interface SchemaManager
schemaLoader
- The schema loader to usepublic DN getNamingContext()
getNamingContext
in interface SchemaManager
public void initialize() throws Exception
initialize
in interface SchemaManager
Exception
- If the initialization failspublic SchemaLoader getLoader()
getLoader
in interface SchemaManager
public AttributeTypeRegistry getAttributeTypeRegistry()
getAttributeTypeRegistry
in interface SchemaManager
public ComparatorRegistry getComparatorRegistry()
getComparatorRegistry
in interface SchemaManager
public DITContentRuleRegistry getDITContentRuleRegistry()
getDITContentRuleRegistry
in interface SchemaManager
public DITStructureRuleRegistry getDITStructureRuleRegistry()
getDITStructureRuleRegistry
in interface SchemaManager
public MatchingRuleRegistry getMatchingRuleRegistry()
getMatchingRuleRegistry
in interface SchemaManager
public MatchingRuleUseRegistry getMatchingRuleUseRegistry()
getMatchingRuleUseRegistry
in interface SchemaManager
public NameFormRegistry getNameFormRegistry()
getNameFormRegistry
in interface SchemaManager
public NormalizerRegistry getNormalizerRegistry()
getNormalizerRegistry
in interface SchemaManager
public ObjectClassRegistry getObjectClassRegistry()
getObjectClassRegistry
in interface SchemaManager
public LdapSyntaxRegistry getLdapSyntaxRegistry()
getLdapSyntaxRegistry
in interface SchemaManager
public SyntaxCheckerRegistry getSyntaxCheckerRegistry()
getSyntaxCheckerRegistry
in interface SchemaManager
public AttributeType lookupAttributeTypeRegistry(String oid) throws LdapException
lookupAttributeTypeRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the AttributeType registrypublic LdapComparator<?> lookupComparatorRegistry(String oid) throws LdapException
lookupComparatorRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the Comparator registrypublic MatchingRule lookupMatchingRuleRegistry(String oid) throws LdapException
lookupMatchingRuleRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the MatchingRule registrypublic Normalizer lookupNormalizerRegistry(String oid) throws LdapException
lookupNormalizerRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the Normalizer registrypublic ObjectClass lookupObjectClassRegistry(String oid) throws LdapException
lookupObjectClassRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the ObjectClass registrypublic LdapSyntax lookupLdapSyntaxRegistry(String oid) throws LdapException
lookupLdapSyntaxRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the LdapSyntax registrypublic SyntaxChecker lookupSyntaxCheckerRegistry(String oid) throws LdapException
lookupSyntaxCheckerRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the SyntaxChecker registrypublic boolean add(SchemaObject schemaObject) throws Exception
add
in interface SchemaManager
schemaObject
- the SchemaObject to registerException
- if the SchemaObject is already registered or
the registration operation is not supportedpublic boolean delete(SchemaObject schemaObject) throws Exception
delete
in interface SchemaManager
schemaObject
- the SchemaObject to unregisterException
- if the SchemaObject is not registered or
the deletion operation is not supportedpublic Map<String,OidNormalizer> getNormalizerMapping()
getNormalizerMapping
in interface SchemaManager
public OidRegistry getGlobalOidRegistry()
getGlobalOidRegistry
in interface SchemaManager
public Schema getLoadedSchema(String schemaName)
getLoadedSchema
in interface SchemaManager
schemaName
- the name of the schema to lookuppublic boolean isSchemaLoaded(String schemaName)
isSchemaLoaded
in interface SchemaManager
schemaName
- The schema we want to checkpublic SchemaObject unregisterAttributeType(String attributeTypeOid) throws LdapException
unregisterAttributeType
in interface SchemaManager
LdapException
- if the attributeType is invalidpublic SchemaObject unregisterComparator(String comparatorOid) throws LdapException
unregisterComparator
in interface SchemaManager
LdapException
- if the Comparator is invalidpublic SchemaObject unregisterDitControlRule(String ditControlRuleOid) throws LdapException
unregisterDitControlRule
in interface SchemaManager
LdapException
- if the DitControlRule is invalidpublic SchemaObject unregisterDitStructureRule(String ditStructureRuleOid) throws LdapException
unregisterDitStructureRule
in interface SchemaManager
LdapException
- if the DitStructureRule is invalidpublic SchemaObject unregisterLdapSyntax(String ldapSyntaxOid) throws LdapException
unregisterLdapSyntax
in interface SchemaManager
LdapException
- if the LdapSyntax is invalidpublic SchemaObject unregisterMatchingRule(String matchingRuleOid) throws LdapException
unregisterMatchingRule
in interface SchemaManager
LdapException
- if the MatchingRule is invalidpublic SchemaObject unregisterMatchingRuleUse(String matchingRuleUseOid) throws LdapException
unregisterMatchingRuleUse
in interface SchemaManager
LdapException
- if the MatchingRuleUse is invalidpublic SchemaObject unregisterNameForm(String nameFormOid) throws LdapException
unregisterNameForm
in interface SchemaManager
LdapException
- if the NameForm is invalidpublic SchemaObject unregisterNormalizer(String normalizerOid) throws LdapException
unregisterNormalizer
in interface SchemaManager
LdapException
- if the Normalizer is invalidpublic SchemaObject unregisterObjectClass(String objectClassOid) throws LdapException
unregisterObjectClass
in interface SchemaManager
LdapException
- if the ObjectClass is invalidpublic SchemaObject unregisterSyntaxChecker(String syntaxCheckerOid) throws LdapException
unregisterSyntaxChecker
in interface SchemaManager
LdapException
- if the SyntaxChecker is invalidpublic boolean isRelaxed()
public boolean isStrict()
public Set<String> listDependentSchemaNames(String schemaName)
listDependentSchemaNames
in interface SchemaManager
schemaName
- The Schema name for which we want to get the list of dependent schemaspublic void setRelaxed()
public void setStrict()
public boolean isDisabled(String schemaName)
isDisabled
in interface SchemaManager
schemaName
- The schema namepublic boolean isDisabled(Schema schema)
isDisabled
in interface SchemaManager
schema
- The schemapublic boolean isEnabled(String schemaName)
isEnabled
in interface SchemaManager
schemaName
- The schema namepublic boolean isEnabled(Schema schema)
isEnabled
in interface SchemaManager
schema
- The schemaCopyright © 2003–2013 The Apache Software Foundation. All rights reserved.