4.1.10.6.11 FindBestParentObject
-
procedure FindBestParentObject( parentObject: DSName, replEntinfList: REPLENTINFLIST, sourcePrefixTable: PrefixTable, nc: DSName, var attributesAndStamps: set of AttributeAndStamp): DSName
Informative summary of behavior: Given a desired parent object, the FindBestParentObject procedure validates whether the desired parent object is deleted. If the object that is being updated is not a deleted object and the desired parent object is deleted, this procedure returns the DSName of the Lost and Found container.
Following are the input parameters for this procedure:
parentObject: The DSName of the desired parent object.
replEntinfList: The replicated update that is to be applied.
sourcePrefixTable: The prefix table from the server.
nc: The DSName of the root of the NC replica.
attributesAndStamps: The AttributeAndStamp set that corresponds to the replicated update (can be modified by this procedure).
isDeletedAttr: ATTRVAL isDeletedValue: boolean attrAndStamp: AttributeAndStamp isDeletedAttr := ENTINF_GetValue( replEntinfList.Entinf, isDeleted, sourcePrefixTable) if (isDeletedAttr = null) then isDeletedValue := false else isDeletedValue := ValueFromATTRVal( isDeletedAttr, Syntax(isDeleted), sourcePrefixTable) endif if isDeletedValue = false and parentObject!isDeleted = true then /* This indicates that an object was moved/created under * parentObject in one NC replica while parentObject was deleted * in another NC replica. In this case move/add an object under * the "lost and found" container. */ /* Remove attribute stamp for name so that the update is seen * as an originating update. */ attrAndStamp := select one from attributesAndStamps where (e.attribute = name) attributesAndStamps := attributesAndStamps - {attrAndStamp} return GetWellKnownObject(nc, GUID_LOSTANDFOUND_CONTAINER_W) endif return parentObject