Examples of JcrActiveLock


Examples of org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock

            try {
                if (!exists()) {
                    log.warn("Unable to retrieve lock: no item found at '" + getResourcePath() + "'");
                } else if (((Node) item).isLocked()) {
                    Lock jcrLock = ((Node) item).getLock();
                    lock = new JcrActiveLock(jcrLock);
                }
            } catch (AccessDeniedException e) {
                log.error("Error while accessing resource lock: "+e.getMessage());
            } catch (UnsupportedRepositoryOperationException e) {
                log.error("Error while accessing resource lock: "+e.getMessage());
View Full Code Here

Examples of org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock

                throw new DavException(DavServletResponse.SC_NOT_FOUND);
            }
            try {
                boolean sessionScoped = EXCLUSIVE_SESSION.equals(reqLockInfo.getScope());
                Lock jcrLock = ((Node)item).lock(reqLockInfo.isDeep(), sessionScoped);
                ActiveLock lock = new JcrActiveLock(jcrLock);
                 // add reference to DAVSession for this lock
                getSession().addReference(lock.getToken());
                return lock;
            } catch (RepositoryException e) {
                // UnsupportedRepositoryOperationException should not occur...
                throw new JcrDavException(e);
            }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock

        if (Type.WRITE.equals(lock.getType())) {
            try {
                Lock jcrLock = ((Node) item).getLock();
                jcrLock.refresh();
                return new JcrActiveLock(jcrLock);
            } catch (RepositoryException e) {
                /*
                  NOTE: LockException is only thrown by Lock.refresh()
                        the lock exception thrown by Node.getLock() was circumvented
                        by the init test if there is a lock applied...
View Full Code Here

Examples of org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock

            // try to retrieve the repository lock information first
            try {
                if (node.isLocked()) {
                    Lock jcrLock = node.getLock();
                    if (jcrLock != null && jcrLock.isLive()) {
                        lock = new JcrActiveLock(jcrLock);
                    }
                }
            } catch (RepositoryException e) {
                // LockException (no lock applies) >> should never occur
                // RepositoryException, AccessDeniedException or another error >> ignore
View Full Code Here

Examples of org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock

            if (isJsrLockable()) {
                try {
                    // try to execute the lock operation
                    Lock jcrLock = node.lock(lockInfo.isDeep(), false);
                    if (jcrLock != null) {
                        lock = new JcrActiveLock(jcrLock);
                    }
                } catch (RepositoryException e) {
                    throw new JcrDavException(e);
                }
            } else {
View Full Code Here

Examples of org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock

                    if (!exists()) {
                        log.warn("Unable to retrieve lock: no item found at '" + getResourcePath() + "'");
                    } else if (((Node) item).isLocked()) {
                        Lock jcrLock = ((Node) item).getLock();
                        // TODO: find out whether this lock is session-scoped or not!
                        lock = new JcrActiveLock(jcrLock);
                    }
                } catch (AccessDeniedException e) {
                    log.error("Error while accessing resource lock: "+e.getMessage());
                } catch (UnsupportedRepositoryOperationException e) {
                    log.error("Error while accessing resource lock: "+e.getMessage());
View Full Code Here

Examples of org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock

                throw new DavException(DavServletResponse.SC_NOT_FOUND);
            }
            try {
                boolean sessionScoped = EXCLUSIVE_SESSION.equals(reqLockInfo.getScope());
                Lock jcrLock = ((Node)item).lock(reqLockInfo.isDeep(), sessionScoped);
                return new JcrActiveLock(jcrLock, sessionScoped);

            } catch (RepositoryException e) {
                // UnsupportedRepositoryOperationException should not occur...
                throw new JcrDavException(e);
            }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock

        if (Type.WRITE.equals(lock.getType())) {
            try {
                Lock jcrLock = ((Node) item).getLock();
                jcrLock.refresh();
                return new JcrActiveLock(jcrLock, EXCLUSIVE_SESSION.equals(lock.getScope()));
            } catch (RepositoryException e) {
                /*
                  NOTE: LockException is only thrown by Lock.refresh()
                        the lock exception thrown by Node.getLock() was circumvented
                        by the init test if there is a lock applied...
View Full Code Here

Examples of org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock

            // try to retrieve the repository lock information first
            try {
                if (node.isLocked()) {
                    Lock jcrLock = node.getLock();
                    if (jcrLock != null && jcrLock.isLive()) {
                        lock = new JcrActiveLock(jcrLock);
                    }
                }
            } catch (RepositoryException e) {
                // LockException (no lock applies) >> should never occur
                // RepositoryException, AccessDeniedException or another error >> ignore
View Full Code Here

Examples of org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock

            if (isJsrLockable()) {
                try {
                    // try to execute the lock operation
                    Lock jcrLock = node.lock(lockInfo.isDeep(), false);
                    if (jcrLock != null) {
                        lock = new JcrActiveLock(jcrLock);
                    }
                } catch (RepositoryException e) {
                    throw new JcrDavException(e);
                }
            } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.