log.debug(msg);
throw new ConstraintViolationException(msg);
}
// do remove conflicting (recursive) including validation check
try {
Operation op = Remove.create(conflicting.getNodeState());
stateMgr.execute(op);
} catch (ItemNotFoundException e) {
// conflicting does not exist any more. no need for a removal
}
// create new with given uuid:
nodeState = importNode(nodeInfo, parent);
break;
case ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING:
if (conflicting.getNodeState().isRoot()) {
msg = "Root node cannot be replaced";
log.debug(msg);
throw new RepositoryException(msg);
}
// 'replace' current parent with parent of conflicting
parent = conflicting.getParent().getNodeState();
// do remove conflicting (recursive), including validation checks
Operation op = Remove.create(conflicting.getNodeState());
stateMgr.execute(op);
// create new with given uuid at same location as conflicting
nodeState = importNode(nodeInfo, parent);
break;