LockData lData = getLockData((NodeData)node.getData(), SEARCH_EXECMATCH | SEARCH_CLOSEDPARENT);
if (lData != null)
{
if (lData.getNodeIdentifier().equals(node.getInternalIdentifier()))
{
throw new LockException("Node already locked: " + node.getData().getQPath());
}
else if (lData.isDeep())
{
throw new LockException("Parent node has deep lock.");
}
}
if (isDeep && getLockData((NodeData)node.getData(), SEARCH_CLOSEDCHILD) != null)
{
throw new LockException("Some child node is locked.");
}
String lockToken = IdGenerator.generate();
lData =
new LockData(node.getInternalIdentifier(), lockToken, isDeep, isSessionScoped, node.getSession().getUserID(),