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

    }

    private void testfmt(long jcrtimeout, String expectedString) throws RepositoryException, URISyntaxException, ParserConfigurationException {

        Lock l = new TestLock(jcrtimeout);
        JcrActiveLock al = new JcrActiveLock(l);

        Document d = DomUtil.createDocument();
        Element activeLock = al.toXml(d);
        assertEquals("activelock", activeLock.getLocalName());
        NodeList nl = activeLock.getElementsByTagNameNS("DAV:", "timeout");

        if (expectedString == null) {
            assertEquals(0, nl.getLength());
View Full Code Here

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);
                    DavResourceLocator locator = super.getLocator();
                    String lockroot = locator
                            .getFactory()
                            .createResourceLocator(locator.getPrefix(), locator.getWorkspacePath(), jcrLock.getNode().getPath(),
                                    false).getHref(false);
View Full Code Here

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

                    timeout = timeout/1000;
                }
                javax.jcr.lock.LockManager lockMgr = getRepositorySession().getWorkspace().getLockManager();
                Lock jcrLock = lockMgr.lock((item).getPath(), reqLockInfo.isDeep(),
                        sessionScoped, timeout, reqLockInfo.getOwner());
                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 {
                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);
                    DavResourceLocator locator = super.getLocator();
                    String lockroot = locator
                            .getFactory()
                            .createResourceLocator(locator.getPrefix(), locator.getWorkspacePath(), jcrLock.getNode().getPath(),
                                    false).getHref(false);
View Full Code Here

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

                    timeout = timeout/1000;
                }
                javax.jcr.lock.LockManager lockMgr = getRepositorySession().getWorkspace().getLockManager();
                Lock jcrLock = lockMgr.lock((item).getPath(), reqLockInfo.isDeep(),
                        sessionScoped, timeout, reqLockInfo.getOwner());
                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
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.