public class DefaultSchemaManager extends Object implements SchemaManager
RELAXED, STRICT
Constructor and Description |
---|
DefaultSchemaManager()
Creates a new instance of DefaultSchemaManager with the default schema schemaLoader
|
DefaultSchemaManager(boolean relaxed,
Collection<Schema> schemas)
Creates a new instance of DefaultSchemaManager with the default schema schemaLoader
|
DefaultSchemaManager(Collection<Schema> schemas)
Creates a new instance of DefaultSchemaManager with the default schema schemaLoader
|
DefaultSchemaManager(SchemaLoader schemaLoader)
Creates a new instance of DefaultSchemaManager with the default schema schemaLoader
|
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.
|
List<Schema> |
getAllSchemas() |
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.
|
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()
Currently not implemented.
|
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 |
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 DefaultSchemaManager()
public DefaultSchemaManager(Collection<Schema> schemas)
schemas
- The list of schema to loadpublic DefaultSchemaManager(SchemaLoader schemaLoader)
schemaLoader
- The schemaLoader containing the schemas to loadpublic DefaultSchemaManager(boolean relaxed, Collection<Schema> schemas)
relaxed
- If the schema manager should be relaxed or notschemas
- The list of schema to loadpublic boolean disable(Schema... schemas) throws LdapException
disable
in interface SchemaManager
schemas
- The list of schemas to disableLdapException
- If something went wrongpublic boolean disable(String... schemaNames) throws LdapException
disable
in interface SchemaManager
schemaNames
- The list of schema names to disableLdapException
- If something went wrongpublic 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
- If something went wrongpublic boolean enable(String... schemaNames) throws LdapException
enable
in interface SchemaManager
schemaNames
- The list of schema name to enableLdapException
- If something went wrongpublic 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<Schema> getAllSchemas()
getAllSchemas
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
- If something went wrongpublic boolean load(String... schemaNames) throws LdapException
SchemaManager.getErrors()
method will contain themload
in interface SchemaManager
schemaNames
- the Schemas' name to loadLdapException
- If something went wrongpublic boolean loadAllEnabled() throws LdapException
loadAllEnabled
in interface SchemaManager
LdapException
- If something went wrongpublic boolean loadAllEnabledRelaxed() throws LdapException
loadAllEnabledRelaxed
in interface SchemaManager
LdapException
- If something went wrongpublic boolean loadDisabled(Schema... schemas) throws LdapException
SchemaManager.getErrors()
method will contain themloadDisabled
in interface SchemaManager
schemas
- The Schemas to loadLdapException
- If something went wrongpublic boolean loadDisabled(String... schemaNames) throws LdapException
SchemaManager.getErrors()
method will contain themloadDisabled
in interface SchemaManager
schemaNames
- The Schemas' name to loadLdapException
- If something went wrongpublic boolean loadRelaxed(Schema... schemas) throws LdapException
SchemaManager.getErrors()
method will contain themloadRelaxed
in interface SchemaManager
schemas
- the Schemas to load, if enabledLdapException
- If something went wrongpublic boolean loadRelaxed(String... schemaNames) throws LdapException
SchemaManager.getErrors()
method will contain themloadRelaxed
in interface SchemaManager
schemaNames
- the Schemas' name to load, if enabledLdapException
- If something went wrongpublic boolean loadWithDeps(Schema... schemas) throws LdapException
SchemaManager.getErrors()
method will contain themloadWithDeps
in interface SchemaManager
schemas
- the Schemas to loadLdapException
- If something went wrongpublic boolean loadWithDeps(String... schemas) throws LdapException
SchemaManager.getErrors()
method will contain themloadWithDeps
in interface SchemaManager
schemas
- the Schemas' name to loadLdapException
- If something went wrongpublic boolean loadWithDepsRelaxed(Schema... schemas) throws LdapException
SchemaManager.getErrors()
method will contain themloadWithDepsRelaxed
in interface SchemaManager
schemas
- the Schemas to loadLdapException
- If something went wrongpublic boolean loadWithDepsRelaxed(String... schemas) throws LdapException
SchemaManager.getErrors()
method will contain themloadWithDepsRelaxed
in interface SchemaManager
schemas
- the Schemas' name to loadLdapException
- If something went wrongpublic 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
- If something went wrongpublic boolean unload(String... schemaNames) throws LdapException
unload
in interface SchemaManager
schemaNames
- The list of Schema to unloadLdapException
- If something went wrongpublic boolean verify(Schema... schemas) throws LdapException
verify
in interface SchemaManager
schemas
- The schemas to checkLdapException
- if something went wrongpublic boolean verify(String... schemas) throws LdapException
verify
in interface SchemaManager
schemas
- The schema names to checkLdapException
- if something went wrongpublic Dn getNamingContext()
getNamingContext
in interface SchemaManager
public void initialize() throws LdapException
initialize
in interface SchemaManager
LdapException
- If the initialization failspublic 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
- 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
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()
isRelaxed
in interface SchemaManager
public boolean isStrict()
isStrict
in interface SchemaManager
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()
setRelaxed
in interface SchemaManager
public void setStrict()
setStrict
in interface SchemaManager
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–2018 The Apache Software Foundation. All rights reserved.