private void acquireLock() { if (lockInfo.isLocked()) { handleLockFailure(lockInfo); } else if (!lockRequestPending) { lockRequestPending = true; final ParameterizedCommand<LockResult> command = new ParameterizedCommand<LockResult>() { @Override public void execute(final LockResult result) { if (result.isSuccess()) { updateLockInfo(result.getLockInfo()); releaseLockOnClose(); } else { handleLockFailure(result.getLockInfo()); } lockRequestPending = false; } }; lockService.acquireLock(lockTarget.getPath(), command); } }
private void fireUpdatedLockStatusEvent() { if (isVisible()) { updatedLockStatusEvent.fire( new UpdatedLockStatusEvent(lockInfo.isLocked(), isLockedByCurrentUser())); } }
private boolean isLocked() { return lockInfo.isLocked(); }
private boolean isLockedByCurrentUser() { return lockInfo.isLocked() && lockInfo.lockedBy().equals(user.getIdentifier()); }