// special case if we are removing the root. Remove all children instead.
if (fqn.isRoot())
{
boolean result = true;
// we need to preserve options
InvocationContext ctx = getInvocationContext();
Option o = ctx.getOptionOverrides();
Set<Fqn> internalFqns = getInternalFqns();
for (Object childName : peek(fqn, false, false).getChildrenNames())
{
if (!internalFqns.contains(Fqn.fromElements(childName)))
{
ctx.setOptionOverrides(o);
result = removeNode(Fqn.fromRelativeElements(fqn, childName)) && result;
}
}
return result;
}
else
{
InvocationContext ctx = invocationContextContainer.get();
cacheStatusCheck(ctx);
GlobalTransaction tx = transactionTable.getCurrentTransaction();
RemoveNodeCommand command = commandsFactory.buildRemoveNodeCommand(tx, fqn);
Object retval = invoker.invoke(ctx, command);
return retval != null && (Boolean) retval;