/** * @inheritDoc */ public void addLockToken(String lockToken) throws UnsupportedRepositoryOperationException, LockException, RepositoryException { session.getWorkspace().getLockManager().addLockToken(lockToken); }
/** * @inheritDoc */ public void addLockToken(String lockToken) throws UnsupportedRepositoryOperationException, LockException, RepositoryException { session.getWorkspace().getLockManager().addLockToken(lockToken); }
@Override public void removeLockToken(String lt) { try { getWorkspace().getLockManager().removeLockToken(checkNotNull(lt)); } catch (RepositoryException e) { log.warn("Unable to remove lock token " + lt + " from session", e); } }
@Override public void removeLockToken(String lt) { try { getWorkspace().getLockManager().removeLockToken(checkNotNull(lt)); } catch (RepositoryException e) { log.warn("Unable to remove lock token " + lt + " from session", e); } }
@Override public void addLockToken(String lt) { try { getWorkspace().getLockManager().addLockToken(checkNotNull(lt)); } catch (RepositoryException e) { log.warn("Unable to add lock token " + lt + " to session", e); } }
@Override @NotNull public String[] getLockTokens() { try { return getWorkspace().getLockManager().getLockTokens(); } catch (RepositoryException e) { log.warn("Unable to retrieve lock tokens from session", e); return new String[0]; } }
@Override public void execute( Session session ) { try { lock = session.getWorkspace().getLockManager().getLock( node.getPath() ); } catch ( InvalidItemStateException | ItemNotFoundException | PathNotFoundException e ) { getLogger().warn( "InvalidItemStateException in getLock. Probable cause: File does not exist anymore" ); } catch ( RepositoryException e ) { getLogger().error( "RepositoryException was found: ", e ); } } } );
/** * {@inheritDoc} */ public void removeLockToken(String lt) { try { getWorkspace().getLockManager().removeLockToken(lt); } catch (RepositoryException e) { log.debug("Error while removing lock token."); } }
/** * {@inheritDoc} */ public void addLockToken(String lt) { try { getWorkspace().getLockManager().addLockToken(lt); } catch (RepositoryException e) { log.debug("Error while adding lock token."); } }
/** * {@inheritDoc} */ public String[] getLockTokens() { try { return getWorkspace().getLockManager().getLockTokens(); } catch (RepositoryException e) { log.debug("Error while accessing lock tokens."); return new String[0]; } }
@Override public Object doInJcr( final Session session ) throws RepositoryException, IOException { PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session ); Node fileNode = session.getNodeByIdentifier( fileId.toString() ); Lock lock = session.getWorkspace().getLockManager().getLock( fileNode.getPath() ); return lockHelper.canUnlock( session, pentahoJcrConstants, lock ); } } );
private void unlock() { try { final LockManager lockManager = UserSession.get().getJcrSession().getWorkspace().getLockManager(); lockManager.unlock(getModelObject().getPath()); } catch (RepositoryException e) { log.error("An error occurred trying to unlock node.", e); } }
/** * {@inheritDoc} */ public Lock getLock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException { // check state of this instance sanityCheck(); LockManager lockMgr = getSession().getWorkspace().getLockManager(); return lockMgr.getLock(getPath()); }
/** * {@inheritDoc} */ public boolean holdsLock() throws RepositoryException { // check state of this instance sanityCheck(); LockManager lockMgr = getSession().getWorkspace().getLockManager(); return lockMgr.holdsLock(getPath()); }
/** * {@inheritDoc} */ public boolean isLocked() throws RepositoryException { // check state of this instance sanityCheck(); LockManager lockMgr = getSession().getWorkspace().getLockManager(); return lockMgr.isLocked(getPath()); }
/** * @inheritDoc */ public Lock getLock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException { final LockManager lockManager = session.getWorkspace().getLockManager(); return lockManager.getLock(getPath()); }
/** * @inheritDoc */ public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException { final LockManager lockManager = session.getWorkspace().getLockManager(); lockManager.unlock(getPath()); }
/** * {@inheritDoc} */ public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException { // check state of this instance sanityCheck(); LockManager lockMgr = getSession().getWorkspace().getLockManager(); lockMgr.unlock(getPath()); }
/** * {@inheritDoc} */ public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException { // check state of this instance sanityCheck(); LockManager lockMgr = getSession().getWorkspace().getLockManager(); lockMgr.unlock(getPath()); }
@SuppressWarnings( "deprecation" ) protected void lock( Node node, boolean isDeep, boolean isSessionScoped ) throws RepositoryException { if (useDeprecatedApi()) { node.lock(isDeep, isSessionScoped); } else { session.getWorkspace().getLockManager().lock(node.getPath(), isDeep, isSessionScoped, 1L, "owner"); } }