use of org.apache.jackrabbit.jcr2spi.operation.LockOperation in project jackrabbit by apache.
the class LockManagerImpl method lock.
/**
* @see LockStateManager#lock(NodeState,boolean,boolean,long,String)
*/
public Lock lock(NodeState nodeState, boolean isDeep, boolean isSessionScoped, long timeoutHint, String ownerHint) throws RepositoryException {
// retrieve node first
Node lhNode;
Item item = itemManager.getItem(nodeState.getHierarchyEntry());
if (item.isNode()) {
lhNode = (Node) item;
} else {
throw new RepositoryException("Internal error: ItemManager returned Property from NodeState");
}
// execute the operation
LockOperation op = LockOperation.create(nodeState, isDeep, isSessionScoped, timeoutHint, ownerHint);
wspManager.execute(op);
Lock lock = new LockImpl(new LockState(nodeState, op.getLockInfo()), lhNode);
return lock;
}
Aggregations