// check if node has been deleted.
if (isFlagSet(DELETED))
{
if (!fqn.isRoot())
{
InternalNode parent = lookupParent(fqn, ctx, container);
parent.removeChild(fqn.getLastElement());
setValid(false, false);
updateNode(fqn, ctx, container);
}
else
{
// should never get here. Other layers should prevent a delete on root.
log.warn("Attempting to remove the root node. Not doing anything!");
}
}
else if (isFlagSet(CREATED))
{
// add newly created nodes to parents.
InternalNode parent = lookupParent(fqn, ctx, container);
parent.addChild(node, true); // we know this is safe since we calculated the parent from the child. No need to have the parent re-do checks when adding the child again.
}
else
{
// Only content has been updated, just update refs.
updateNode(fqn, ctx, container);