public class DefaultSchemaManager extends Object implements SchemaManager
Modifier and Type | Field and Description |
---|---|
static boolean |
RELAXED
Two flags for RELAXED and STRICT, this is RELAXED
|
static boolean |
STRICT
Two flags for RELAXED and STRICT, this is STRICT
|
Constructor and Description |
---|
DefaultSchemaManager()
Creates a new instance of DefaultSchemaManager with the default schema schemaLoader
|
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.
|
AttributeType |
getAttributeType(String oid)
Get an AttributeType in the AttributeType registry.
|
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.
|
public static final boolean STRICT
public static final boolean RELAXED
public DefaultSchemaManager() throws Exception
loader
- The schema loader to useException
public DefaultSchemaManager(SchemaLoader loader)
loader
- The schema loader to usepublic DefaultSchemaManager(SchemaLoader loader, Dn namingContext)
loader
- The schema loader to usenamingContext
- The associated NamingContextpublic boolean disable(Schema... schemas) throws LdapException
disable
in interface SchemaManager
schemas
- The list of schemas to disableLdapException
public boolean disable(String... schemaNames) throws LdapException
disable
in interface SchemaManager
schemaNames
- The list of schema names to disableLdapException
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 LdapException
enable
in interface SchemaManager
schemas
- The list of schemas to enableLdapException
public boolean enable(String... schemaNames) throws LdapException
enable
in interface SchemaManager
schemaNames
- The list of schema name to enableLdapException
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 LdapException
SchemaManager.getErrors()
method will contain themload
in interface SchemaManager
schemas
- the Schemas to loadLdapException
public 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 LdapException
SchemaManager.getErrors()
method will contain themloadDisabled
in interface SchemaManager
schemas
- The Schemas to loadLdapException
public boolean loadDisabled(String... schemaNames) throws LdapException
SchemaManager.getErrors()
method will contain themloadDisabled
in interface SchemaManager
schemaNames
- The Schemas' name to loadLdapException
public 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 LdapException
unload
in interface SchemaManager
schemas
- The list of Schema to unloadLdapException
public boolean unload(String... schemaNames) throws LdapException
unload
in interface SchemaManager
schemaNames
- The list of Schema to unloadLdapException
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
oid
- the OID we are looking forLdapException
- if the OID is not found in the AttributeType registrypublic AttributeType getAttributeType(String oid)
getAttributeType
in interface SchemaManager
oid
- the OID we are looking forpublic LdapComparator<?> lookupComparatorRegistry(String oid) throws LdapException
lookupComparatorRegistry
in interface SchemaManager
oid
- the OID we are looking forLdapException
- if the OID is not found in the Comparator registrypublic MatchingRule lookupMatchingRuleRegistry(String oid) throws LdapException
lookupMatchingRuleRegistry
in interface SchemaManager
oid
- the OID we are looking forLdapException
- if the OID is not found in the MatchingRule registrypublic Normalizer lookupNormalizerRegistry(String oid) throws LdapException
lookupNormalizerRegistry
in interface SchemaManager
oid
- the OID we are looking forLdapException
- if the OID is not found in the Normalizer registrypublic ObjectClass lookupObjectClassRegistry(String oid) throws LdapException
lookupObjectClassRegistry
in interface SchemaManager
oid
- the OID we are looking forLdapException
- if the OID is not found in the ObjectClass registrypublic LdapSyntax lookupLdapSyntaxRegistry(String oid) throws LdapException
lookupLdapSyntaxRegistry
in interface SchemaManager
oid
- the OID we are looking forLdapException
- if the OID is not found in the LdapSyntax registrypublic SyntaxChecker lookupSyntaxCheckerRegistry(String oid) throws LdapException
lookupSyntaxCheckerRegistry
in interface SchemaManager
oid
- the OID we are looking forLdapException
- if the OID is not found in the SyntaxChecker registrypublic boolean add(SchemaObject schemaObject) throws LdapException
add
in interface SchemaManager
schemaObject
- the SchemaObject to registerLdapException
- if the SchemaObject is already registered or
the registration operation is not supportedpublic boolean delete(SchemaObject schemaObject) throws LdapException
delete
in interface SchemaManager
schemaObject
- the SchemaObject to unregisterLdapException
public 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
attributeTypeOid
- the attributeType OID to unregisterLdapException
- if the attributeType is invalidpublic SchemaObject unregisterComparator(String comparatorOid) throws LdapException
unregisterComparator
in interface SchemaManager
comparatorOid
- the Comparator OID to unregisterLdapException
- if the Comparator is invalidpublic SchemaObject unregisterDitControlRule(String ditControlRuleOid) throws LdapException
unregisterDitControlRule
in interface SchemaManager
ditControlRuleOid
- the DitControlRule OID to unregisterLdapException
- if the DitControlRule is invalidpublic SchemaObject unregisterDitStructureRule(String ditStructureRuleOid) throws LdapException
unregisterDitStructureRule
in interface SchemaManager
ditStructureRuleOid
- the DitStructureRule OID to unregisterLdapException
- if the DitStructureRule is invalidpublic SchemaObject unregisterLdapSyntax(String ldapSyntaxOid) throws LdapException
unregisterLdapSyntax
in interface SchemaManager
ldapSyntaxOid
- the LdapSyntax OID to unregisterLdapException
- if the LdapSyntax is invalidpublic SchemaObject unregisterMatchingRule(String matchingRuleOid) throws LdapException
unregisterMatchingRule
in interface SchemaManager
matchingRuleOid
- the MatchingRuleRule OID to unregisterLdapException
- if the MatchingRule is invalidpublic SchemaObject unregisterMatchingRuleUse(String matchingRuleUseOid) throws LdapException
unregisterMatchingRuleUse
in interface SchemaManager
matchingRuleUseOid
- the MatchingRuleUse OID to unregisterLdapException
- if the MatchingRuleUse is invalidpublic SchemaObject unregisterNameForm(String nameFormOid) throws LdapException
unregisterNameForm
in interface SchemaManager
nameFormOid
- the NameForm OID to unregisterLdapException
- if the NameForm is invalidpublic SchemaObject unregisterNormalizer(String normalizerOid) throws LdapException
unregisterNormalizer
in interface SchemaManager
normalizerOid
- the Normalizer OID to unregisterLdapException
- if the Normalizer is invalidpublic SchemaObject unregisterObjectClass(String objectClassOid) throws LdapException
unregisterObjectClass
in interface SchemaManager
objectClassOid
- the ObjectClass OID to unregisterLdapException
- if the ObjectClass is invalidpublic SchemaObject unregisterSyntaxChecker(String syntaxCheckerOid) throws LdapException
unregisterSyntaxChecker
in interface SchemaManager
syntaxCheckerOid
- the SyntaxChecker OID to unregisterLdapException
- 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-2014 The Apache Software Foundation. All Rights Reserved.