Class Registries
- java.lang.Object
-
- org.apache.directory.api.ldap.model.schema.registries.Registries
-
- All Implemented Interfaces:
Cloneable,SchemaLoaderListener
public class Registries extends Object implements SchemaLoaderListener, Cloneable
Document this class.- Author:
- Apache Directory Project
-
-
Field Summary
Fields Modifier and Type Field Description protected DefaultAttributeTypeRegistryattributeTypeRegistryThe AttributeType registryprotected DefaultComparatorRegistrycomparatorRegistryThe LdapSyntax registryprivate booleandisabledAcceptedA flag indicating that disabled SchemaObject are acceptedprotected DefaultDitContentRuleRegistryditContentRuleRegistryThe DitContentRule registryprotected DefaultDitStructureRuleRegistryditStructureRuleRegistryThe DitStructureRule registryprivate SchemaErrorHandlererrorHandlerprotected OidRegistry<SchemaObject>globalOidRegistryThe global OID registryprivate booleanisRelaxedA flag indicating that the Registries is relaxed or notprotected DefaultLdapSyntaxRegistryldapSyntaxRegistryThe LdapSyntax registryprotected Map<String,Schema>loadedSchemasA String name to Schema object map for the schemas loaded into this registry.private static org.slf4j.LoggerLOGA logger for this classprotected DefaultMatchingRuleRegistrymatchingRuleRegistryThe MatchingRule registryprotected DefaultMatchingRuleUseRegistrymatchingRuleUseRegistryThe MatchingRuleUse registryprotected DefaultNameFormRegistrynameFormRegistryThe NameForm registryprotected DefaultNormalizerRegistrynormalizerRegistryThe Normalizer registryprotected DefaultObjectClassRegistryobjectClassRegistryThe ObjectClass registrystatic booleanRELAXEDThe relaxed modeprivate Map<String,Set<SchemaObjectWrapper>>schemaObjectsA map storing all the schema objects associated with a schemastatic booleanSTRICTThe strict modeprotected DefaultSyntaxCheckerRegistrysyntaxCheckerRegistryThe SyntaxChecker registryprotected Map<SchemaObjectWrapper,Set<SchemaObjectWrapper>>usedByA map storing a relation between a SchemaObject and all the referencing SchemaObjects.protected Map<SchemaObjectWrapper,Set<SchemaObjectWrapper>>usingA map storing a relation between a SchemaObject and all the SchemaObjects it uses.
-
Constructor Summary
Constructors Constructor Description Registries()Creates a new instance of Registries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(SchemaObject schemaObject, boolean check)Applies the added SchemaObject to the given registervoidaddReference(SchemaObject base, SchemaObject referenced)Add an association between a SchemaObject an the SchemaObject it refersSet<SchemaObjectWrapper>addSchema(String schemaName)Create a new schema association with its contentprivate voidaddUsedBy(SchemaObject referee, SchemaObject reference)Add an association between a SchemaObject an the SchemaObject that refers itprivate voidaddUsing(SchemaObject reference, SchemaObject referee)Add an association between a SchemaObject an the SchemaObject it refersvoidassociateWithSchema(SchemaObject schemaObject)Store the given SchemaObject in the Map associating SchemaObjetcs to their related Schema.private voidbuildAttributeTypeReferences()Build the AttributeType references.private voidbuildComparatorReferences()Build the Comparator referencesprivate voidbuildDitContentRuleReferences()Build the DitContentRule referencesprivate voidbuildDitStructureRuleReferences()Build the DitStructureRule referencesprivate voidbuildLdapSyntaxReferences()Build the Syntax referencesprivate voidbuildMatchingRuleReferences()Build the MatchingRule referencesprivate voidbuildMatchingRuleUseReferences()Build the MatchingRuleUse referencesprivate voidbuildNameFormReferences()Build the NameForm referencesprivate voidbuildNormalizerReferences()Build the Normalizer referencesprivate voidbuildObjectClassReferences()Build the ObjectClasses referencesvoidbuildReference(SchemaObject schemaObject)Build the SchemaObject referencesvoidbuildReferences()Build the usedBy and using references from the stored elements.private voidbuildSyntaxCheckerReferences()Build the SyntaxChecker referencesbooleancheck()Check the registries for invalid relations.private booleancheckReferences(SchemaObject reference, SchemaObject referee, String message)voidcheckRefInteg()Attempts to resolve the dependent schema objects of all entities that refer to other objects within the registries.voidclear()Clear the registries from all its elementsRegistriesclone()Clone the Registries.booleancontains(SchemaObject schemaObject)Tells if the given SchemaObject is present in one schema.voiddelCrossReferences(AttributeType attributeType)Add the SchemaObjectReferences.voiddelCrossReferences(MatchingRule matchingRule)Delete the MR references (using and usedBy) : MR -> C MR -> N MR -> Svoiddelete(SchemaObject schemaObject)Remove the given SchemaObject from the registriesvoiddelReference(SchemaObject base, SchemaObject referenced)Delete an association between a SchemaObject an the SchemaObject it refersprivate voiddelUsedBy(SchemaObject referee, SchemaObject reference)Del an association between a SchemaObject an the SchemaObject that refers itprivate voiddelUsing(SchemaObject reference, SchemaObject referee)Del an association between a SchemaObject an the SchemaObject it refersvoiddissociateFromSchema(SchemaObject schemaObject)Store the given SchemaObject in the Map associating SchemaObjetcs to their related Schema.private Stringdump(String op, SchemaObject reference, SchemaObject referee)Dump the reference operation as a StringStringdumpUsedBy()Dump the UsedBy data structure as a StringStringdumpUsing()Dump the Using data structure as a StringAttributeTypeRegistrygetAttributeTypeRegistry()ComparatorRegistrygetComparatorRegistry()DitContentRuleRegistrygetDitContentRuleRegistry()DitStructureRuleRegistrygetDitStructureRuleRegistry()SchemaErrorHandlergetErrorHandler()OidRegistry<SchemaObject>getGlobalOidRegistry()LdapSyntaxRegistrygetLdapSyntaxRegistry()SchemagetLoadedSchema(String schemaName)Gets a schema that has been loaded into these Registries.Map<String,Schema>getLoadedSchemas()Gets an unmodifiable Map of schema names to loaded Schema objects.MatchingRuleRegistrygetMatchingRuleRegistry()MatchingRuleUseRegistrygetMatchingRuleUseRegistry()private List<AttributeType>getMustRecursive(List<AttributeType> musts, Set<ObjectClass> processed, ObjectClass objectClass)NameFormRegistrygetNameFormRegistry()NormalizerRegistrygetNormalizerRegistry()Map<String,Set<SchemaObjectWrapper>>getObjectBySchemaName()ObjectClassRegistrygetObjectClassRegistry()StringgetOid(String name)Get an OID from a name.Set<SchemaObjectWrapper>getReferencing(SchemaObject schemaObject)Check that we can remove a given SchemaObject without breaking some of its references.private StringgetSchemaName(SchemaObject schemaObject)Retrieve the schema name for a specific SchemaObject, or return "other" if none is found.SyntaxCheckerRegistrygetSyntaxCheckerRegistry()Set<SchemaObjectWrapper>getUsedBy(SchemaObject schemaObject)Gets the Set of SchemaObjects referencing the given SchemaObjectSet<SchemaObjectWrapper>getUsing(SchemaObject schemaObject)Gets the Set of SchemaObjects referenced by the given SchemaObjectbooleanisDisabledAccepted()Tells if the Registries accept disabled elements.booleanisReferenced(SchemaObject schemaObject)Checks if a specific SchemaObject is referenced by any other SchemaObject.booleanisRelaxed()Tells if the Registries is permissive or if it must be checked against inconsistencies.booleanisSchemaLoaded(String schemaName)Checks to see if a particular Schema is loaded.booleanisStrict()Tells if the Registries is strict.private voidregister(SchemaObject schemaObject)Register the given SchemaObject into the associated RegistryvoidremoveReference(SchemaObject schemaObject)Unlink the SchemaObject referencesprivate voidresolve(AttributeType attributeType)Check the inheritance, and the existence of MatchingRules and LdapSyntax for an attributeprivate voidresolve(LdapComparator<?> comparator)Attempts to resolve the LdapComparatorprivate voidresolve(LdapSyntax syntax)Attempts to resolve the SyntaxChecker associated with a Syntax.private voidresolve(MatchingRule matchingRule)Check if the Comparator, Normalizer and the syntax are existing for a matchingRule.private voidresolve(Normalizer normalizer)Attempts to resolve the Normalizerprivate voidresolve(ObjectClass objectClass)private voidresolve(SyntaxChecker syntaxChecker)Attempts to resolve the SyntaxCheckerprivate voidresolveRecursive(AttributeType attributeType, Set<String> processed)Check AttributeType referential integrityprivate voidresolveRecursive(ObjectClass objectClass, Set<String> processed)voidschemaLoaded(Schema schema)Merely adds the schema to the set of loaded schemas.voidschemaUnloaded(Schema schema)Merely removes the schema from the set of loaded schemas.voidsetDisabledAccepted(boolean disabledAccepted)Change the Registries behavior regarding disabled SchemaObject element.voidsetErrorHandler(SchemaErrorHandler errorHandler)voidsetRelaxed()Change the Registries to a relaxed mode, where invalid SchemaObjects can be registered.voidsetStrict()Change the Registries to a strict mode, where invalid SchemaObjects cannot be registered.StringtoString()private SchemaObjectunregister(SchemaObject schemaObject)Unregister a SchemaObject from the registries
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
A logger for this class
-
loadedSchemas
protected Map<String,Schema> loadedSchemas
A String name to Schema object map for the schemas loaded into this registry. The loaded schemas may be disabled.
-
attributeTypeRegistry
protected DefaultAttributeTypeRegistry attributeTypeRegistry
The AttributeType registry
-
objectClassRegistry
protected DefaultObjectClassRegistry objectClassRegistry
The ObjectClass registry
-
comparatorRegistry
protected DefaultComparatorRegistry comparatorRegistry
The LdapSyntax registry
-
ditContentRuleRegistry
protected DefaultDitContentRuleRegistry ditContentRuleRegistry
The DitContentRule registry
-
ditStructureRuleRegistry
protected DefaultDitStructureRuleRegistry ditStructureRuleRegistry
The DitStructureRule registry
-
matchingRuleRegistry
protected DefaultMatchingRuleRegistry matchingRuleRegistry
The MatchingRule registry
-
matchingRuleUseRegistry
protected DefaultMatchingRuleUseRegistry matchingRuleUseRegistry
The MatchingRuleUse registry
-
nameFormRegistry
protected DefaultNameFormRegistry nameFormRegistry
The NameForm registry
-
normalizerRegistry
protected DefaultNormalizerRegistry normalizerRegistry
The Normalizer registry
-
globalOidRegistry
protected OidRegistry<SchemaObject> globalOidRegistry
The global OID registry
-
syntaxCheckerRegistry
protected DefaultSyntaxCheckerRegistry syntaxCheckerRegistry
The SyntaxChecker registry
-
ldapSyntaxRegistry
protected DefaultLdapSyntaxRegistry ldapSyntaxRegistry
The LdapSyntax registry
-
schemaObjects
private Map<String,Set<SchemaObjectWrapper>> schemaObjects
A map storing all the schema objects associated with a schema
-
isRelaxed
private boolean isRelaxed
A flag indicating that the Registries is relaxed or not
-
disabledAccepted
private boolean disabledAccepted
A flag indicating that disabled SchemaObject are accepted
-
errorHandler
private SchemaErrorHandler errorHandler
-
STRICT
public static final boolean STRICT
The strict mode- See Also:
- Constant Field Values
-
RELAXED
public static final boolean RELAXED
The relaxed mode- See Also:
- Constant Field Values
-
usedBy
protected Map<SchemaObjectWrapper,Set<SchemaObjectWrapper>> usedBy
A map storing a relation between a SchemaObject and all the referencing SchemaObjects.
-
using
protected Map<SchemaObjectWrapper,Set<SchemaObjectWrapper>> using
A map storing a relation between a SchemaObject and all the SchemaObjects it uses.
-
-
Method Detail
-
getAttributeTypeRegistry
public AttributeTypeRegistry getAttributeTypeRegistry()
- Returns:
- The AttributeType registry
-
getComparatorRegistry
public ComparatorRegistry getComparatorRegistry()
- Returns:
- The Comparator registry
-
getDitContentRuleRegistry
public DitContentRuleRegistry getDitContentRuleRegistry()
- Returns:
- The DitContentRule registry
-
getDitStructureRuleRegistry
public DitStructureRuleRegistry getDitStructureRuleRegistry()
- Returns:
- The DitStructureRule registry
-
getMatchingRuleRegistry
public MatchingRuleRegistry getMatchingRuleRegistry()
- Returns:
- The MatchingRule registry
-
getMatchingRuleUseRegistry
public MatchingRuleUseRegistry getMatchingRuleUseRegistry()
- Returns:
- The MatchingRuleUse registry
-
getNameFormRegistry
public NameFormRegistry getNameFormRegistry()
- Returns:
- The NameForm registry
-
getNormalizerRegistry
public NormalizerRegistry getNormalizerRegistry()
- Returns:
- The Normalizer registry
-
getObjectClassRegistry
public ObjectClassRegistry getObjectClassRegistry()
- Returns:
- The ObjectClass registry
-
getGlobalOidRegistry
public OidRegistry<SchemaObject> getGlobalOidRegistry()
- Returns:
- The global Oid registry
-
getSyntaxCheckerRegistry
public SyntaxCheckerRegistry getSyntaxCheckerRegistry()
- Returns:
- The SyntaxChecker registry
-
getLdapSyntaxRegistry
public LdapSyntaxRegistry getLdapSyntaxRegistry()
- Returns:
- The LdapSyntax registry
-
getOid
public String getOid(String name)
Get an OID from a name. As we have many possible registries, we have to look in all of them to get the one containing the OID.- Parameters:
name- The name we are looking at- Returns:
- The associated OID
-
getLoadedSchema
public Schema getLoadedSchema(String schemaName)
Gets a schema that has been loaded into these Registries.- Parameters:
schemaName- the name of the schema to lookup- Returns:
- the loaded Schema if one corresponding to the name exists
-
isSchemaLoaded
public boolean isSchemaLoaded(String schemaName)
Checks to see if a particular Schema is loaded.- Parameters:
schemaName- the name of the Schema to check- Returns:
- true if the Schema is loaded, false otherwise
-
checkRefInteg
public void checkRefInteg()
Attempts to resolve the dependent schema objects of all entities that refer to other objects within the registries. Null references will be handed appropriately. The order in which the SchemaObjects must be :- 1) Normalizers, Comparators and SyntaxCheckers (as they depend on nothing)
- 2) Syntaxes (depend on SyntaxCheckers)
- 3) MatchingRules (depend on Syntaxes, Normalizers and Comparators
- 4) AttributeTypes (depend on MatchingRules, Syntaxes and AttributeTypes : in this case, we first handle the superior)
- 5) ObjectClasses (depend on AttributeTypes and ObjectClasses)
Later, when we will support them :- 6) MatchingRuleUses (depend on matchingRules and AttributeTypes)
- 7) DitContentRules (depend on ObjectClasses and AttributeTypes)
- 8) NameForms (depends on ObjectClasses and AttributeTypes)
- 9) DitStructureRules (depends onNameForms and DitStructureRules)
-
delCrossReferences
public void delCrossReferences(AttributeType attributeType)
Add the SchemaObjectReferences. This method does nothing, it's just a catch all. The other methods will be called for each specific schemaObject public void addCrossReferences( SchemaObject schemaObject ) { // Do nothing : it's a catch all method. } /** Delete the AT references (using and usedBy) : AT -> MR (for EQUALITY, ORDERING and SUBSTR) AT -> S AT -> AT- Parameters:
attributeType- The AttributeType to remove
-
buildAttributeTypeReferences
private void buildAttributeTypeReferences()
Build the AttributeType references. This has to be done recursively, as an AttributeType may inherit its parent's MatchingRules. The references to update are : - EQUALITY MR - ORDERING MR - SUBSTRING MR - SUP AT - SYNTAX
-
buildComparatorReferences
private void buildComparatorReferences()
Build the Comparator references
-
buildDitContentRuleReferences
private void buildDitContentRuleReferences()
Build the DitContentRule references
-
buildDitStructureRuleReferences
private void buildDitStructureRuleReferences()
Build the DitStructureRule references
-
delCrossReferences
public void delCrossReferences(MatchingRule matchingRule)
Delete the MR references (using and usedBy) : MR -> C MR -> N MR -> S- Parameters:
matchingRule- The MatchinRule refere ce to delete
-
buildReference
public void buildReference(SchemaObject schemaObject)
Build the SchemaObject references- Parameters:
schemaObject- The SchemaObject to add
-
removeReference
public void removeReference(SchemaObject schemaObject)
Unlink the SchemaObject references- Parameters:
schemaObject- The SchemaObject to remove
-
buildMatchingRuleReferences
private void buildMatchingRuleReferences()
Build the MatchingRule references
-
buildMatchingRuleUseReferences
private void buildMatchingRuleUseReferences()
Build the MatchingRuleUse references
-
buildNameFormReferences
private void buildNameFormReferences()
Build the NameForm references
-
buildNormalizerReferences
private void buildNormalizerReferences()
Build the Normalizer references
-
buildObjectClassReferences
private void buildObjectClassReferences()
Build the ObjectClasses references
-
buildLdapSyntaxReferences
private void buildLdapSyntaxReferences()
Build the Syntax references
-
buildSyntaxCheckerReferences
private void buildSyntaxCheckerReferences()
Build the SyntaxChecker references
-
buildReferences
public void buildReferences()
Build the usedBy and using references from the stored elements.
-
resolve
private void resolve(LdapSyntax syntax)
Attempts to resolve the SyntaxChecker associated with a Syntax.- Parameters:
syntax- the LdapSyntax to resolve the SyntaxChecker of
-
resolve
private void resolve(Normalizer normalizer)
Attempts to resolve the Normalizer- Parameters:
normalizer- the Normalizer
-
resolve
private void resolve(LdapComparator<?> comparator)
Attempts to resolve the LdapComparator- Parameters:
comparator- the LdapComparator
-
resolve
private void resolve(SyntaxChecker syntaxChecker)
Attempts to resolve the SyntaxChecker- Parameters:
syntaxChecker- the SyntaxChecker
-
resolve
private void resolve(MatchingRule matchingRule)
Check if the Comparator, Normalizer and the syntax are existing for a matchingRule.- Parameters:
matchingRule- The matching rule to use
-
resolveRecursive
private void resolveRecursive(AttributeType attributeType, Set<String> processed)
Check AttributeType referential integrity- Parameters:
attributeType- The AttributeTypeprocessed- The set of superior to check
-
resolve
private void resolve(AttributeType attributeType)
Check the inheritance, and the existence of MatchingRules and LdapSyntax for an attribute- Parameters:
attributeType- The AttributeType
-
getMustRecursive
private List<AttributeType> getMustRecursive(List<AttributeType> musts, Set<ObjectClass> processed, ObjectClass objectClass)
-
resolve
private void resolve(ObjectClass objectClass)
-
resolveRecursive
private void resolveRecursive(ObjectClass objectClass, Set<String> processed)
-
add
public void add(SchemaObject schemaObject, boolean check) throws LdapException
Applies the added SchemaObject to the given register- Parameters:
schemaObject- The SchemaObject to addcheck- A flag set when we want the schema checks to be done- Throws:
LdapException- If we weren't able to add the SchemaObject
-
delete
public void delete(SchemaObject schemaObject) throws LdapException
Remove the given SchemaObject from the registries- Parameters:
schemaObject- The SchemaObject to delete- Throws:
LdapException- If the deletion failed
-
schemaLoaded
public void schemaLoaded(Schema schema)
Merely adds the schema to the set of loaded schemas. Does not actually do any work to add schema objects to registries. Listener method called to indicate a loader or other agent finished loading the schema objects for a schema into the Registries.- Specified by:
schemaLoadedin interfaceSchemaLoaderListener- Parameters:
schema- the Schema that was loaded
-
schemaUnloaded
public void schemaUnloaded(Schema schema)
Merely removes the schema from the set of loaded schemas. Does not actually do any work to remove schema objects from registries. Listener method called to indicate an agent finished loading the schema objects for a schema into the Registries.- Specified by:
schemaUnloadedin interfaceSchemaLoaderListener- Parameters:
schema- the Schema that was unloaded
-
getLoadedSchemas
public Map<String,Schema> getLoadedSchemas()
Gets an unmodifiable Map of schema names to loaded Schema objects.- Returns:
- the map of loaded Schema objects
-
getObjectBySchemaName
public Map<String,Set<SchemaObjectWrapper>> getObjectBySchemaName()
- Returns:
- Gets a reference to the Map associating a schemaName to its contained SchemaObjects
-
getSchemaName
private String getSchemaName(SchemaObject schemaObject)
Retrieve the schema name for a specific SchemaObject, or return "other" if none is found.- Parameters:
schemaObject- The SchemaObject- Returns:
- The associated Schema
-
contains
public boolean contains(SchemaObject schemaObject)
Tells if the given SchemaObject is present in one schema. The schema may be disabled.- Parameters:
schemaObject- The schemaObject we are looking for- Returns:
- true if the schemaObject is present in a schema
-
addSchema
public Set<SchemaObjectWrapper> addSchema(String schemaName)
Create a new schema association with its content- Parameters:
schemaName- The schema name- Returns:
- A set containing the associations
-
register
private void register(SchemaObject schemaObject) throws LdapException
Register the given SchemaObject into the associated Registry- Parameters:
schemaObject- The SchemaObject to register- Throws:
LdapException- If the SchemaObject cannot be registered
-
associateWithSchema
public void associateWithSchema(SchemaObject schemaObject)
Store the given SchemaObject in the Map associating SchemaObjetcs to their related Schema.- Parameters:
schemaObject- The schemaObject to register
-
dissociateFromSchema
public void dissociateFromSchema(SchemaObject schemaObject) throws LdapException
Store the given SchemaObject in the Map associating SchemaObjetcs to their related Schema.- Parameters:
schemaObject- The schemaObject to register- Throws:
LdapException- If there is a problem
-
unregister
private SchemaObject unregister(SchemaObject schemaObject) throws LdapException
Unregister a SchemaObject from the registries- Parameters:
schemaObject- The SchemaObject we want to deregister- Returns:
- The unregistred SchemaObject
- Throws:
LdapException- If the removal failed
-
isReferenced
public boolean isReferenced(SchemaObject schemaObject)
Checks if a specific SchemaObject is referenced by any other SchemaObject.- Parameters:
schemaObject- The SchemaObject we are looking for- Returns:
- true if there is at least one SchemaObjetc referencing the given one
-
getUsedBy
public Set<SchemaObjectWrapper> getUsedBy(SchemaObject schemaObject)
Gets the Set of SchemaObjects referencing the given SchemaObject- Parameters:
schemaObject- The SchemaObject we are looking for- Returns:
- The Set of referencing SchemaObject, or null
-
dumpUsedBy
public String dumpUsedBy()
Dump the UsedBy data structure as a String- Returns:
- The UsedBy data structure
-
dumpUsing
public String dumpUsing()
Dump the Using data structure as a String- Returns:
- The Using data structure
-
getUsing
public Set<SchemaObjectWrapper> getUsing(SchemaObject schemaObject)
Gets the Set of SchemaObjects referenced by the given SchemaObject- Parameters:
schemaObject- The SchemaObject we are looking for- Returns:
- The Set of referenced SchemaObject, or null
-
addUsing
private void addUsing(SchemaObject reference, SchemaObject referee)
Add an association between a SchemaObject an the SchemaObject it refers- Parameters:
reference- The base SchemaObjectreferee- The SchemaObject pointing on the reference
-
addReference
public void addReference(SchemaObject base, SchemaObject referenced)
Add an association between a SchemaObject an the SchemaObject it refers- Parameters:
base- The base SchemaObjectreferenced- The referenced SchemaObject
-
addUsedBy
private void addUsedBy(SchemaObject referee, SchemaObject reference)
Add an association between a SchemaObject an the SchemaObject that refers it- Parameters:
reference- The base SchemaObjectreferee- The SchemaObject pointing on the reference
-
delUsing
private void delUsing(SchemaObject reference, SchemaObject referee)
Del an association between a SchemaObject an the SchemaObject it refers- Parameters:
reference- The base SchemaObjectreferee- The SchemaObject pointing on the reference
-
delUsedBy
private void delUsedBy(SchemaObject referee, SchemaObject reference)
Del an association between a SchemaObject an the SchemaObject that refers it- Parameters:
reference- The base SchemaObjectreferee- The SchemaObject pointing on the reference
-
delReference
public void delReference(SchemaObject base, SchemaObject referenced)
Delete an association between a SchemaObject an the SchemaObject it refers- Parameters:
base- The base SchemaObjectreferenced- The referenced SchemaObject
-
dump
private String dump(String op, SchemaObject reference, SchemaObject referee)
Dump the reference operation as a String- Parameters:
op- The operationreference- The referencereferee- The referee- Returns:
- The resulting string
-
checkReferences
private boolean checkReferences(SchemaObject reference, SchemaObject referee, String message)
-
check
public boolean check()
Check the registries for invalid relations. This check stops at the first error.- Returns:
- true if the Registries is consistent, false otherwise
-
clone
public Registries clone() throws CloneNotSupportedException
Clone the Registries. This is done in two steps : - first clone the SchemaObjetc registries - second restore the relation between them- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
isRelaxed
public boolean isRelaxed()
Tells if the Registries is permissive or if it must be checked against inconsistencies.- Returns:
- True if SchemaObjects can be added even if they break the consistency
-
isStrict
public boolean isStrict()
Tells if the Registries is strict.- Returns:
- True if SchemaObjects cannot be added if they break the consistency
-
setRelaxed
public void setRelaxed()
Change the Registries to a relaxed mode, where invalid SchemaObjects can be registered.
-
setStrict
public void setStrict()
Change the Registries to a strict mode, where invalid SchemaObjects cannot be registered.
-
getErrorHandler
public SchemaErrorHandler getErrorHandler()
-
setErrorHandler
public void setErrorHandler(SchemaErrorHandler errorHandler)
-
isDisabledAccepted
public boolean isDisabledAccepted()
Tells if the Registries accept disabled elements.- Returns:
- True if disabled SchemaObjects can be added
-
getReferencing
public Set<SchemaObjectWrapper> getReferencing(SchemaObject schemaObject)
Check that we can remove a given SchemaObject without breaking some of its references. We will return the list of refereing objects.- Parameters:
schemaObject- The SchemaObject to remove- Returns:
- The list of SchemaObjects referencing the SchemaObjetc we want to remove
-
setDisabledAccepted
public void setDisabledAccepted(boolean disabledAccepted)
Change the Registries behavior regarding disabled SchemaObject element.- Parameters:
disabledAccepted- Iffalse, then the Registries won't accept disabled SchemaObject or enabled SchemaObject from disabled schema
-
clear
public void clear() throws LdapExceptionClear the registries from all its elements- Throws:
LdapException- If something goes wrong
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
-