Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We have 11 different SchemaObjects, 3 of them are Apache DS specific :

  • (AT) AttributeType
  • (C) Comparator (specific)
  • (DCR) DITContentRule
  • (DSR) DITStructureRule
  • (MR) MatchingRule
  • (MRU) MatchingRuleUse
  • (NF) NameForm
  • (N) Normalizer (specific)
  • (OC) ObjectClass
  • (S) Syntax
  • (SC) SyntaxChecker (specific)

The specific SchemaObjects are those we can load into the server dynamically : they are compiled Java classes.

...

This is a more complex operation, as we may have some MatchingRules pointing on this object.
We have to :
remove the oid from the ComparatorRegistry.byOid
remove the oid from the ComparatorRegistry.byName
remove the Comparator from the bySchemaNameSchemaObject map : <schema, set<SchemaObject>> -= comparator

DITContentRule

Not Yet Implemented

DITStructureRule

Not Yet Implemented

MatchingRule

the Comparator from the bySchemaNameSchemaObject map : <schema, set<SchemaObject>> -= comparator

DITContentRule

Not Yet Implemented

DITStructureRule

Not Yet Implemented

MatchingRule

Here are the fields stored in a MatchingRule instance :

Name

default

description

N/A

extensions

N/A

isEnabled

TRUE

isObsolete

FALSE

isReadOnly

FALSE

names

No names

objectType

ATTRIBUTE_TYPE

oid

AT OID

schemaName

N/A

ldapComparator

Comparator reference

ldapSyntax

Syntax reference

ldapSyntaxOid

The Syntax OID

normalizer

Normalizer reference

Adding a MatchingRule

Register the MatchingRule into the MatchingRuleRegistry :
update the MatchingRuleRegistry.byOid : add <oid, MatchingRule>
update the MatchingRuleRegistry.byName : add <oid, MatchingRule>
associate the MatchingRule with the schema : <schema, set<SchemaObject>> += MatchingRule
update the Registries.globalOidRegistry : add <oid, MatchingRule>

When all the schema modifications will be done, do the additional updates :

update the MatchingRule.syntax : SyntaxRegistry.lookup( syntaxoid )
update the MatchingRule.normalizer : NormalizerRegistry.lookup( matchingRule.oid )
update the MatchingRule.comparator : ComparatorRegistry.lookup( matchingRule.oid )
update the Registries.using map : <MatchingRule.oid, set<SchemaObject>> += syntax, normalizer, comparator
update the Registries.usedBy map :
<Syntax.oid, set<SchemaObject>> += MatchingRule
<Comparator.oid, set<SchemaObject>> += MatchingRule
<Normalizer.oid, set<SchemaObject>> += MatchingRule

Modifying a MatchingRule

We won't create a new object, but will update the existing one. The OID can't be changed

If we have changed the (N)ormalizer, the (S)yntax or the (C)omparator, when all the schema
modifications will be done, do the additional updates :
update the MatchingRule.<C/N/S> : <C/S/N>Registry.lookup( oid )
update the Registries.using map : <MatchingRule.oid, set<SchemaObject>> -= old <C/S/N>
update the Registries.using map : <MatchingRule.oid, set<SchemzObject>> += new <C/S/N>
update the Registries.usedBy map : <old <C/S/N>.oid, set<SchemaObject>> -= MatchingRule
update the Registries.usedBy map : <new <C/S/N>.oid, set<SchemaObject>> += MatchingRule

Deleting a MatchingRule

We can't delete a MatchingRule which is used by an AttributeType. This is checked by verifying in
the usedBy table :

if usedBy.get( MatchingRule.oid ) is not empty, generate an error.

Otherwise, here are the operations we have to conduct :
remove the MatchingRule.oid from the MatchingRuleRegistry.byOid
for each MatchingRule's name,
remove the MatchingRule.name from the MatchingRuleRegistry.byName
remove the MatchingRule from the bySchemaNameSchemaObject map : <schema, set<SchemaObject>> -= MatchingRule

When all the schema modifications will be done, do the additional updates :

update the Registries.using map : remove the relation <MatchingRule.oid, set<SchemaObject>>
update the Registries.usedBy map for each C/S/N referenced in the MatchingRule :
<<C/S/N>.oid, set<SchemaObject>> -= MatchingRuleTODO

MatchingRuleUse

Not Yet Implemented

...

update the Syntax.syntaxChecker : SyntaxCheckerRegistry.lookup( oid )
update the Registries.using map : <Syntax.oid, set<SyntaxChecker>> set<SchemaObject>> += SyntaxChecker
update the Registries.usedBy map : <SyntaxChecker.oid, set<Syntax>> set<SchemaObject>> += Syntax

Modifying a Syntax

...

If we have changed the SyntaxChecker, when all the schema modifications will be done, do the
additional updates :
update the Syntax.syntaxChecker : SyntaxCheckerRegistry.lookup( oid )
update the Registries.using map : <Syntax.oid, set<SyntaxChecker>> set<SchemaObject>> -= old SyntaxChecker
update the Registries.using map : <Syntax.oid, set<SyntaxChecker>> set<SchemaObject>> += new SyntaxChecker
update the Registries.usedBy map : <old SyntaxChecker.oid, set<Syntax>> set<SchemaObject>> -= Syntax
update the Registries.usedBy map : <new SyntaxChecker.oid, set<Syntax>> set<SchemaObject>> += Syntax

Deleting a Syntax

We can't delete a schema Syntax which is used by either a MatchingRule or an AttributeType. This is checked by verifying in
the usedBy table :

...

update the Registries.using map : remove the relation <Syntax.oid, set<SyntaxChecker>>set<SchemaObject>>
update the Registries.usedBy map : <SyntaxChecker.oid, set<Syntax>> set<SchemaObject>> -= Syntax

SyntaxChecker (specific)

...