|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.schema.manager.impl.DefaultSchemaManager
public class DefaultSchemaManager
The SchemaManager class : it handles all the schema operations (addition, removal, modification).
Field Summary | |
---|---|
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 Summary | |
---|---|
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 |
Method Summary | |
---|---|
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(java.lang.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(java.lang.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(java.lang.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(java.lang.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 |
java.util.List<Schema> |
getDisabled()
|
DITContentRuleRegistry |
getDITContentRuleRegistry()
Get an immutable reference on the DITContentRule registry |
DITStructureRuleRegistry |
getDITStructureRuleRegistry()
Get an immutable reference on the DITStructureRule registry |
java.util.List<Schema> |
getEnabled()
|
java.util.List<java.lang.Throwable> |
getErrors()
|
OidRegistry |
getGlobalOidRegistry()
Returns a reference to the global OidRegistry |
LdapSyntaxRegistry |
getLdapSyntaxRegistry()
Get an immutable reference on the LdapSyntax registry |
Schema |
getLoadedSchema(java.lang.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()
|
java.util.Map<java.lang.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(java.lang.String schemaName)
Tells if the given Schema is disabled |
boolean |
isDisabledAccepted()
|
boolean |
isEnabled(Schema schema)
Tells if the given Schema is enabled |
boolean |
isEnabled(java.lang.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(java.lang.String schemaName)
Tells if the specific schema is loaded |
boolean |
isStrict()
Tells if the SchemaManager is strict. |
java.util.Set<java.lang.String> |
listDependentSchemaNames(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String... schemas)
Load some Schemas into the registries, and loads all of the schemas they depend on. |
AttributeType |
lookupAttributeTypeRegistry(java.lang.String oid)
Lookup for an AttributeType in the AttributeType registry |
LdapComparator<?> |
lookupComparatorRegistry(java.lang.String oid)
Lookup for a Comparator in the Comparator registry |
LdapSyntax |
lookupLdapSyntaxRegistry(java.lang.String oid)
Lookup for an LdapSyntax in the LdapSyntax registry |
MatchingRule |
lookupMatchingRuleRegistry(java.lang.String oid)
Lookup for a MatchingRule in the MatchingRule registry |
Normalizer |
lookupNormalizerRegistry(java.lang.String oid)
Lookup for a Normalizer in the Normalizer registry |
ObjectClass |
lookupObjectClassRegistry(java.lang.String oid)
Lookup for a ObjectClass in the ObjectClass registry |
SyntaxChecker |
lookupSyntaxCheckerRegistry(java.lang.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(java.lang.String... schemaNames)
Unload the given set of Schemas |
SchemaObject |
unregisterAttributeType(java.lang.String attributeTypeOid)
Removes the registered attributeType from the attributeTypeRegistry |
SchemaObject |
unregisterComparator(java.lang.String comparatorOid)
Removes the registered Comparator from the ComparatorRegistry |
SchemaObject |
unregisterDitControlRule(java.lang.String ditControlRuleOid)
Removes the registered DitControlRule from the DitControlRuleRegistry |
SchemaObject |
unregisterDitStructureRule(java.lang.String ditStructureRuleOid)
Removes the registered DitStructureRule from the DitStructureRuleRegistry |
SchemaObject |
unregisterLdapSyntax(java.lang.String ldapSyntaxOid)
Removes the registered LdapSyntax from the LdapSyntaxRegistry |
SchemaObject |
unregisterMatchingRule(java.lang.String matchingRuleOid)
Removes the registered MatchingRule from the MatchingRuleRegistry |
SchemaObject |
unregisterMatchingRuleUse(java.lang.String matchingRuleUseOid)
Removes the registered MatchingRuleUse from the MatchingRuleUseRegistry |
SchemaObject |
unregisterNameForm(java.lang.String nameFormOid)
Removes the registered NameForm from the NameFormRegistry |
SchemaObject |
unregisterNormalizer(java.lang.String normalizerOid)
Removes the registered Normalizer from the NormalizerRegistry |
SchemaObject |
unregisterObjectClass(java.lang.String objectClassOid)
Removes the registered ObjectClass from the ObjectClassRegistry |
SchemaObject |
unregisterSyntaxChecker(java.lang.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(java.lang.String... schemas)
Check that the Schemas are consistent regarding the current Registries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final EntityFactory factory
public static final boolean STRICT
public static final boolean RELAXED
Constructor Detail |
---|
public DefaultSchemaManager(SchemaLoader loader) throws java.lang.Exception
loader
- The schema loader to use
java.lang.Exception
public DefaultSchemaManager(SchemaLoader loader, DN namingContext) throws java.lang.Exception
loader
- The schema loader to usenamingContext
- The associated NamingContext
java.lang.Exception
Method Detail |
---|
public boolean disable(Schema... schemas) throws java.lang.Exception
disable
in interface SchemaManager
schemas
- The list of schemas to disable
java.lang.Exception
public boolean disable(java.lang.String... schemaNames) throws java.lang.Exception
disable
in interface SchemaManager
schemaNames
- The list of schema names to disable
java.lang.Exception
public boolean disabledRelaxed(Schema... schemas)
disabledRelaxed
in interface SchemaManager
schemas
- The list of schemas to disable
public boolean disabledRelaxed(java.lang.String... schemas)
disabledRelaxed
in interface SchemaManager
schemas
- The list of schema names to disable
public java.util.List<Schema> getDisabled()
getDisabled
in interface SchemaManager
public boolean enable(Schema... schemas) throws java.lang.Exception
enable
in interface SchemaManager
schemas
- The list of schemas to enable
java.lang.Exception
public boolean enable(java.lang.String... schemaNames) throws java.lang.Exception
enable
in interface SchemaManager
schemaNames
- The list of schema name to enable
java.lang.Exception
public boolean enableRelaxed(Schema... schemas)
enableRelaxed
in interface SchemaManager
schemas
- The list of schemas to enable
public boolean enableRelaxed(java.lang.String... schemas)
enableRelaxed
in interface SchemaManager
schemas
- The list of schema names to enable
public java.util.List<Schema> getEnabled()
getEnabled
in interface SchemaManager
public java.util.List<java.lang.Throwable> getErrors()
getErrors
in interface SchemaManager
public Registries getRegistries()
getRegistries
in interface SchemaManager
public boolean isDisabledAccepted()
public boolean load(Schema... schemas) throws java.lang.Exception
SchemaManager.getErrors()
method will contain them
load
in interface SchemaManager
schemas
- the Schemas to load
java.lang.Exception
- @TODOpublic boolean load(java.lang.String... schemaNames) throws java.lang.Exception
SchemaManager.getErrors()
method will contain them
load
in interface SchemaManager
schemaNames
- the Schemas' name to load
java.lang.Exception
- @TODOpublic boolean loadAllEnabled() throws java.lang.Exception
loadAllEnabled
in interface SchemaManager
java.lang.Exception
- @TODOpublic boolean loadAllEnabledRelaxed() throws java.lang.Exception
loadAllEnabledRelaxed
in interface SchemaManager
java.lang.Exception
- @TODOpublic boolean loadDisabled(Schema... schemas) throws java.lang.Exception
SchemaManager.getErrors()
method will contain them
loadDisabled
in interface SchemaManager
schemas
- The Schemas to load
java.lang.Exception
- @TODOpublic boolean loadDisabled(java.lang.String... schemaNames) throws java.lang.Exception
SchemaManager.getErrors()
method will contain them
loadDisabled
in interface SchemaManager
schemaNames
- The Schemas' name to load
java.lang.Exception
- @TODOpublic boolean loadRelaxed(Schema... schemas) throws java.lang.Exception
SchemaManager.getErrors()
method will contain them
loadRelaxed
in interface SchemaManager
schemas
- the Schemas to load, if enabled
java.lang.Exception
- @TODOpublic boolean loadRelaxed(java.lang.String... schemaNames) throws java.lang.Exception
SchemaManager.getErrors()
method will contain them
loadRelaxed
in interface SchemaManager
schemaNames
- the Schemas' name to load, if enabled
java.lang.Exception
- @TODOpublic boolean loadWithDeps(Schema... schemas) throws java.lang.Exception
SchemaManager.getErrors()
method will contain them
loadWithDeps
in interface SchemaManager
schemas
- the Schemas to load
java.lang.Exception
- @TODOpublic boolean loadWithDeps(java.lang.String... schemas) throws java.lang.Exception
SchemaManager.getErrors()
method will contain them
loadWithDeps
in interface SchemaManager
schemas
- the Schemas' name to load
java.lang.Exception
- @TODOpublic boolean loadWithDepsRelaxed(Schema... schemas) throws java.lang.Exception
SchemaManager.getErrors()
method will contain them
loadWithDepsRelaxed
in interface SchemaManager
schemas
- the Schemas to load
java.lang.Exception
- @TODOpublic boolean loadWithDepsRelaxed(java.lang.String... schemas) throws java.lang.Exception
SchemaManager.getErrors()
method will contain them
loadWithDepsRelaxed
in interface SchemaManager
schemas
- the Schemas' name to load
java.lang.Exception
- @TODOpublic void setRegistries(Registries registries)
setRegistries
in interface SchemaManager
registries
- The new Registriespublic boolean unload(Schema... schemas) throws java.lang.Exception
unload
in interface SchemaManager
schemas
- The list of Schema to unload
java.lang.Exception
public boolean unload(java.lang.String... schemaNames) throws java.lang.Exception
unload
in interface SchemaManager
schemaNames
- The list of Schema to unload
java.lang.Exception
public boolean verify(Schema... schemas) throws java.lang.Exception
verify
in interface SchemaManager
schemas
- The schemas to check
java.lang.Exception
- if something went wrongpublic boolean verify(java.lang.String... schemas) throws java.lang.Exception
verify
in interface SchemaManager
schemas
- The schema names to check
java.lang.Exception
- 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 java.lang.Exception
initialize
in interface SchemaManager
java.lang.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(java.lang.String oid) throws LdapException
lookupAttributeTypeRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the AttributeType registrypublic LdapComparator<?> lookupComparatorRegistry(java.lang.String oid) throws LdapException
lookupComparatorRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the Comparator registrypublic MatchingRule lookupMatchingRuleRegistry(java.lang.String oid) throws LdapException
lookupMatchingRuleRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the MatchingRule registrypublic Normalizer lookupNormalizerRegistry(java.lang.String oid) throws LdapException
lookupNormalizerRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the Normalizer registrypublic ObjectClass lookupObjectClassRegistry(java.lang.String oid) throws LdapException
lookupObjectClassRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the ObjectClass registrypublic LdapSyntax lookupLdapSyntaxRegistry(java.lang.String oid) throws LdapException
lookupLdapSyntaxRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the LdapSyntax registrypublic SyntaxChecker lookupSyntaxCheckerRegistry(java.lang.String oid) throws LdapException
lookupSyntaxCheckerRegistry
in interface SchemaManager
LdapException
- if the OID is not found in the SyntaxChecker registrypublic boolean add(SchemaObject schemaObject) throws java.lang.Exception
add
in interface SchemaManager
schemaObject
- the SchemaObject to register
java.lang.Exception
- if the SchemaObject is already registered or
the registration operation is not supportedpublic boolean delete(SchemaObject schemaObject) throws java.lang.Exception
delete
in interface SchemaManager
schemaObject
- the SchemaObject to unregister
java.lang.Exception
- if the SchemaObject is not registered or
the deletion operation is not supportedpublic java.util.Map<java.lang.String,OidNormalizer> getNormalizerMapping()
getNormalizerMapping
in interface SchemaManager
public OidRegistry getGlobalOidRegistry()
getGlobalOidRegistry
in interface SchemaManager
public Schema getLoadedSchema(java.lang.String schemaName)
getLoadedSchema
in interface SchemaManager
schemaName
- the name of the schema to lookup
public boolean isSchemaLoaded(java.lang.String schemaName)
isSchemaLoaded
in interface SchemaManager
schemaName
- The schema we want to check
public SchemaObject unregisterAttributeType(java.lang.String attributeTypeOid) throws LdapException
unregisterAttributeType
in interface SchemaManager
LdapException
- if the attributeType is invalidpublic SchemaObject unregisterComparator(java.lang.String comparatorOid) throws LdapException
unregisterComparator
in interface SchemaManager
LdapException
- if the Comparator is invalidpublic SchemaObject unregisterDitControlRule(java.lang.String ditControlRuleOid) throws LdapException
unregisterDitControlRule
in interface SchemaManager
LdapException
- if the DitControlRule is invalidpublic SchemaObject unregisterDitStructureRule(java.lang.String ditStructureRuleOid) throws LdapException
unregisterDitStructureRule
in interface SchemaManager
LdapException
- if the DitStructureRule is invalidpublic SchemaObject unregisterLdapSyntax(java.lang.String ldapSyntaxOid) throws LdapException
unregisterLdapSyntax
in interface SchemaManager
LdapException
- if the LdapSyntax is invalidpublic SchemaObject unregisterMatchingRule(java.lang.String matchingRuleOid) throws LdapException
unregisterMatchingRule
in interface SchemaManager
LdapException
- if the MatchingRule is invalidpublic SchemaObject unregisterMatchingRuleUse(java.lang.String matchingRuleUseOid) throws LdapException
unregisterMatchingRuleUse
in interface SchemaManager
LdapException
- if the MatchingRuleUse is invalidpublic SchemaObject unregisterNameForm(java.lang.String nameFormOid) throws LdapException
unregisterNameForm
in interface SchemaManager
LdapException
- if the NameForm is invalidpublic SchemaObject unregisterNormalizer(java.lang.String normalizerOid) throws LdapException
unregisterNormalizer
in interface SchemaManager
LdapException
- if the Normalizer is invalidpublic SchemaObject unregisterObjectClass(java.lang.String objectClassOid) throws LdapException
unregisterObjectClass
in interface SchemaManager
LdapException
- if the ObjectClass is invalidpublic SchemaObject unregisterSyntaxChecker(java.lang.String syntaxCheckerOid) throws LdapException
unregisterSyntaxChecker
in interface SchemaManager
LdapException
- if the SyntaxChecker is invalidpublic boolean isRelaxed()
public boolean isStrict()
public java.util.Set<java.lang.String> listDependentSchemaNames(java.lang.String schemaName)
listDependentSchemaNames
in interface SchemaManager
schemaName
- The Schema name for which we want to get the list of dependent schemas
public void setRelaxed()
public void setStrict()
public boolean isDisabled(java.lang.String schemaName)
isDisabled
in interface SchemaManager
schemaName
- The schema name
public boolean isDisabled(Schema schema)
isDisabled
in interface SchemaManager
schema
- The schema
public boolean isEnabled(java.lang.String schemaName)
isEnabled
in interface SchemaManager
schemaName
- The schema name
public boolean isEnabled(Schema schema)
isEnabled
in interface SchemaManager
schema
- The schema
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |