/** * Determine if this lock manager holds a lock on the supplied node. * * @param node the node; may not be null * @return true if this lock maanger does hold a lock on the node, or false otherwise */ public boolean holdsLock( AbstractJcrNode node ) { return lockManager.findLockFor(node.key()) != null; }
/** * Determine if this lock manager holds a lock on the supplied node. * * @param node the node; may not be null * @return true if this lock maanger does hold a lock on the node, or false otherwise */ public boolean holdsLock( AbstractJcrNode node ) { return lockManager.findLockFor(node.key()) != null; }
@Override public boolean holdsLock( String absPath ) throws PathNotFoundException, RepositoryException { AbstractJcrNode node = session.node(session.absolutePathFor(absPath)); return lockManager.findLockFor(node.key()) != null; }
@Override public boolean holdsLock( String absPath ) throws PathNotFoundException, RepositoryException { AbstractJcrNode node = session.node(session.absolutePathFor(absPath)); return lockManager.findLockFor(node.key()) != null; }
public void unlock( AbstractJcrNode node ) throws PathNotFoundException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException { if (node.isModified()) { throw new InvalidItemStateException(JcrI18n.changedNodeCannotBeUnlocked.text(node.getPath())); } ModeShapeLock lock = lockManager.findLockFor(node.key()); if (lock != null && !lockTokens.contains(lock.getLockToken())) { // Someone else holds the lock, so see if the user has the permission to break someone else's lock ... try { session.checkPermission(session.workspaceName(), node.path(), ModeShapePermissions.UNLOCK_ANY); } catch (AccessDeniedException e) { //expected by the TCK throw new LockException(e); } } // Remove the lock ... String lockToken = lockManager.unlock(session, node.key()); lockTokens.remove(lockToken); }
public void unlock( AbstractJcrNode node ) throws PathNotFoundException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException { if (node.isModified()) { throw new InvalidItemStateException(JcrI18n.changedNodeCannotBeUnlocked.text(node.getPath())); } ModeShapeLock lock = lockManager.findLockFor(node.key()); if (lock != null && !lockTokens.contains(lock.getLockToken())) { // Someone else holds the lock, so see if the user has the permission to break someone else's lock ... try { session.checkPermission(session.workspaceName(), node.path(), ModeShapePermissions.UNLOCK_ANY); } catch (AccessDeniedException e) { //expected by the TCK throw new LockException(e); } } // Remove the lock ... String lockToken = lockManager.unlock(session, node.key()); lockTokens.remove(lockToken); }
NodeKey key = nodeKey; while (key != null) { ModeShapeLock lock = lockManager.findLockFor(key); if (lock != null && (lock.isDeep() || nodeKey.equals(lock.getLockedNodeKey()))) { if (!lock.isExpired() || !skipExpiredLocks) {
NodeKey key = nodeKey; while (key != null) { ModeShapeLock lock = lockManager.findLockFor(key); if (lock != null && (lock.isDeep() || nodeKey.equals(lock.getLockedNodeKey()))) { if (!lock.isExpired() || !skipExpiredLocks) {