Versions Compared

Key

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

...

All the SchemaObjects are related with each other. The following schema shows all the existing relations :

This class diagram exposes the relations between all those classes :

All the Registries contain two data structure :

  • byOid : stores all the associated SchemaObject by their OID
  • byName : stores all the associated SchemaObject by their name (slao contains the oid)

Note that the ObjectClassRegistry and the AttributeTypeRegistry contain a specific data structure
to keep a track of the descendants for each AT or OC.

AttributeType

Here are the fields stored in a AttributeType instance :

...

Register the AttributeType into the AttributeTypeRegistry :
update the AttributeTypeRegistry.byOid : add <oid, AttributeType>
for all the attributeType names, plus the oid,
update the AttributeTypeRegistry.byName : add <name, AttributeType>
update the AttributeTypeRegistry.byName : add <oid, AttributeType>
associate the AttributeType with the schema : <schema, set<SchemaObject>> += AttributeType
update the Registries.globalOidRegistry : add <oid, AttributeType>

We also have a special data structure to update :

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

update the AttributeType.syntax : SyntaxRegistry.lookup( syntaxOid )
update the AttributeType.equality : MatchingRuleRegistry.lookup( equalityOid )
update the AttributeType.ordering : MatchingRuleRegistry.lookup( orderingOid )
update the AttributeType.substring : MatchingRuleRegistry.lookup( substringOid )
update the AttributeType.sup : AttributeTypeAttributeTypeRegistry.lookup( superiorOid )
update the Registries.using map : <AttributeType.oid, set<SchemaObject>> +=
syntax, equality, ordering, substring, superior
update the Registries.usedBy map :
<Syntax.oid, set<SchemaObject>> += AttributeType
<equalityOid, set<SchemaObject>> += AttributeType
<orderingOid, set<SchemaObject>> += AttributeType
<substringOid, set<SchemaObject>> += AttributeType
<superiorOid, set<SchemaObject>> += AttributeType

last, not least, update the AttributeTypeRegistry oidNormalizerMap and oidToDescendant data structures :
AttributeTypeRegistry.oidNormalizerMap += new OidNormalizer( oid, NormalizerRegistry.lookup( equality.getNormalizer() )
AttributeTypeRegistry.oidToDescendant : <superiorOid, Set<AttributeType>> += attributeType

There are special cases to deal with :

  • if the Syntax is null, then inherit it from the superior, whcih must not be null
  • if the equality is null, and if we have a superior, inherit the equality from it
  • if there is a superior, the Usage must be the same than its superior's
  • if the superior is COLLECTIVE, the it must also be COLLECTIVE
  • if it's COLLECTIVE, then the Usage must be operational

NOTE : The OidNormalizerMap is probably useless

Modifying an AttributeType

...

If we have changed one of the MRs, or the S, or the superior AT, when all the schema
modifications will be done, do the additional updates :
update the AttributeType.<MR/S/sup> : <MR/S/AT>Registry.lookup( oid )
update the Registries.using map : <AttributeType.oid, set<SchemaObject>> -= old <MR/S/AT>
update the Registries.using map : <AttributeType.oid, set<SchemzObject>> += new <MR/S/AT>
update the Registries.usedBy map : <old <MR/S/AT>.oid, set<SchemaObject>> -= AttributeType
update the Registries.usedBy map : <new <MR/S/AT>.oid, set<SchemaObject>> += AttributeType
update the oidNormalizerMap : remove the Oidnormalizer, add the new one
update the oidToDescendant Map : remove the AT from the old superior, add it to the new superior

We will We will also have to check that the modified AT is still valid

...

remove the oid from the AttributeTypeRegistry.byOid
for each AttributeType's name,
remove the AttributeType.name from the AttributeTypeRegistry.byName
+ remove the AttributeType.oid from the AttributeTypeRegistry.byName
remove all the names and the oid from the AttributeTypeRegistry.byName
remove the AttributeType from the bySchemaNameSchemaObject map : <schema, set<SchemaObject>> -= AttributeType
remove the AttributeType.oid from the globalOidRegistry : remove <oid, AttributeType>
remove the AttributeType's OidNormalizer from the oidNormalizerMap

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

update the Registries.using map : remove the relation <AttributeType.oid, set<SchemaObject>>
update the Registries.usedBy map for each AT/MR/S referenced in the AttributeType :
<<AT/MR/S>.oid, set<SchemaObject>> -= AttributeType
remove the AttributeType from the oidToDescendant Map

Comparator

Here are the fields stored in a Comparator instance :

...

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

ObjectClass

Here are the fields stored in a ObjectClass

...

instance :

Name

default

description

N/A

extensions

N/A

isEnabled

TRUE

isObsolete

FALSE

isReadOnly

FALSE

names

No names

objectType

NORMALIZER

oid

MR OID

schemaName

N/A

specification

not modifiable

mayAttributeTypes

all the referenced MAY attributeType

mayAttributeTypeOids

all the referenced MAY attributeType's oid

mustAttributeTypes

all the referenced MUST attributeType

mustAttributeTypeOids

all the referenced MUST attributeType's oid

objectClassType

STRUCTURAL

superiors

all the inherited SUPERIOR

superiorOids

all the inherited SUPERIOR's oid

Adding an ObjectClass

Register the ObjectClass into the ObjectClassRegistry :
update the ObjectClassRegistry.byOid : add <oid, ObjectClass>
for all the ObjectClass names, plus the oid,
update the ObjectClassRegistry.byName : add <name, ObjectClass>
update the ObjectClassRegistry.byName : add <oid, ObjectClass>
associate the ObjectClassType with the schema : <schema, set<SchemaObject>> += ObjectClass
update the Registries.globalOidRegistry : add <oid, ObjectClass>

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

update all the ObjectClass.may : AttributeTypeRegistry.lookup( mayOid )
update all the ObjectClassType.must : AttributeTypeRegistry.lookup( mustOid )
update all the ObjectClass.superiors : ObjectClassRegistry.lookup( superiorOid )
update the Registries.using map : <ObjectClass.oid, set<SchemaObject>> +=
all the may, all the must, all the superiors
update the Registries.usedBy map for each may, must and superior :
<may.oid, set<SchemaObject>> += ObjectClass
<must.Oid, set<SchemaObject>> += ObjectClassuteType
<superior.oid, set<SchemaObject>> += ObjectClass

If the added ObjectClass inherits from one ore more ObjectClass, update the oidToDescendant map :
for each superiorOid :
<superiorOid, Set<ObjectClass>> += ObjectClass

There are special cases to deal with :

  • If the ObjectClass is ABSTRACT, then it can inherit from a STRUCTURAL or AUXILIARY ObjectClass
  • If the ObjectClass is AUXILIARY, then it can't inherit from a STRUCTURAL ObjectClass
  • If the ObjectClass is STRUCTURAL, then it can't inherit from a AUXILIARY ObjectClass

Modifying an ObjectClass

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

We will also have to check that the modified AT is still valid

Deleting an ObjectClass

We can't delete an Objectlass if it's refered by another ObjectClass.
This is checked by verifying inthe usedBy table :

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

remove the oid from the ObjectClassRegistry.byOid
for each ObjectClass's name,
remove the ObjectClass.name from the ObjectClassRegistry.byName
+ remove the ObjectClass.oid from the ObjectClassRegistry.byName
remove the ObjectClass from the bySchemaNameSchemaObject map : <schema, set<SchemaObject>> -= ObjectClass
remove the ObjectClass.oid from the globalOidRegistry : remove <oid, ObjectClass>

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

update the Registries.using map : remove the relation <ObjectClass.oid, set<SchemaObject>>TODO

Syntax

Here are the fields stored in a Syntax instance :

...