Here is the description of an Add operation, and how it's handled by the
AdministrativePoint handler. The parts between >>>--- and ---<<< are
pseudo code.
+--+
|AP|
+--+
We have to deal with three cases :
- the AP has a parent AP (IAP or SAP, it's irrelevant) and no
subordinate IAP
- the AP has a parent AP but some subordinate IAPs
in this second case, we have to change the IAPs seqNumber to reflect
the change in entries relationship, recusively.
- the AP has no parent AP
The second case is the most complex.
>>>-------------------------------------------
for each AP role
get a new seqNumber, add it to the AP(role)
update the AP(role) cache
if hasParentAP( AP(role) )
then
if hasSubordonateIAP( AP(role) )
then
for each subordinate IAP(role) (and their own subordinates)
modify the subordinate IAP(role) seqNumber with the new
seqNumber
store the IAP(role)
done
done
continue down the chain
-------------------------------------------<<<
+--------+
|Subentry|
+--------+
We can't add a subentry if the immediate parent is not an AP and if the
parent AP does not have the same role (or of the parent is an IAP and
there are no higher parent with the same role).
Otherwise, adding a subentry is just a matter to update the parent's AP
seqNumber (and all the hierarchy up to the first SAP if it's an IAP)
As a subentry is only associated with one single role, we don't have to
loop on all the roles
>>>-------------------------------------------
check the parentAP for the role
get a new new seqNumber
update the parentAP and all its IAP subordinate with the same role with
the new seqNumber
continue down the chain
-------------------------------------------<<<
+-----+
|Entry|
+-----+
When we add an entry, we have to check if it depends on an AP for each
roles. If so, we have to add the AP seqNumber into the entry, and add
references to all the subentry it is related too.
>>>-------------------------------------------
for each role
for each parent AP(role)
get the parentAP(role) seqNumber, store it into the entry
for each subentry associated with the AP(role) do
if the entry is part of the subtree
then add the subentry entryUUID into the entry references
done
done
done
continue down the chain
-------------------------------------------<<<
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com