Package org.apache.jackrabbit.ocm.exception

Examples of org.apache.jackrabbit.ocm.exception.LockedException


            javax.jcr.lock.Lock lock = node.getLock();
            String lockOwner = lock.getLockOwner();

            if (!session.getUserID().equals(lockOwner)) {
                final String path = lock.getNode().getPath();
                throw new LockedException(lockOwner, path);
            }
        }
    }
View Full Code Here


            javax.jcr.lock.Lock lock = getLockManager().getLock(absPath);
            String lockOwner = lock.getLockOwner();

            if (!session.getUserID().equals(lockOwner)) {
                final String path = lock.getNode().getPath();
                throw new LockedException(lockOwner, path);
            }
        }
    }
View Full Code Here

            // session already has lock token
            String[] lockTokens = null;
            try {
                lockTokens = getLockManager().getLockTokens();
            } catch (UnsupportedRepositoryOperationException ex) {
                throw new LockedException(session.getUserID(), path);
            } catch (RepositoryException ex) {
                throw new org.apache.jackrabbit.ocm.exception.RepositoryException(ex.getMessage(), ex);
            }
            if (lockTokens != null) {
                for (int i = 0; i < lockTokens.length; i++) {
                    if (lockTokens[i].equals(lockToken)) {
                        // we are already holding a lock
                        break;
                    }
                }
            } else {
                try {
                    getLockManager().addLockToken(lockToken);
                } catch (UnsupportedRepositoryOperationException ex) {
                    throw new LockedException(session.getUserID(), path);
                } catch (RepositoryException ex) {
                    throw new org.apache.jackrabbit.ocm.exception.RepositoryException(ex.getMessage(), ex);
                }
            }
        }
View Full Code Here

            javax.jcr.lock.Lock lock = node.getLock();
            String lockOwner = lock.getLockOwner();

            if (!session.getUserID().equals(lockOwner)) {
                final String path = lock.getNode().getPath();
                throw new LockedException(lockOwner, path);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.ocm.exception.LockedException

Copyright © 2018 www.massapicom. 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.