Examples of LockException


Examples of javax.jcr.lock.LockException

      AccessDeniedException, RepositoryException
   {
      checkValid();

      if (!isNodeType(Constants.MIX_LOCKABLE))
         throw new LockException("Node is not lockable " + getPath());

      // session.checkPermission(getPath(), PermissionType.SET_PROPERTY) is not used because RepositoryException
      // is wrapped into AccessControlException
      if (!session.getAccessManager().hasPermission(getACL(), new String[]{PermissionType.SET_PROPERTY},
         session.getUserState().getIdentity()))
View Full Code Here

Examples of javax.jcr.lock.LockException

      }

      // Check locking
      if (!checkLocking())
      {
         throw new LockException("Node " + getPath() + " is locked ");
      }

      session.getActionHandler().preRemoveMixin(this, name);

      PropertyData propData =
View Full Code Here

Examples of javax.jcr.lock.LockException

      if (!versionHistory(false).isVersionBelongToThis(version))
         throw new VersionException("Bad version " + version.getPath());

      // Check locking
      if (!checkLocking())
         throw new LockException("Node " + getPath() + " is locked ");

      NodeData destParent = (NodeData)dataManager.getItemData(nodeData().getParentIdentifier());
      ((VersionImpl)version).restore(this.getSession(), destParent, nodeData().getQPath().getName(), removeExisting);
   }
View Full Code Here

Examples of javax.jcr.lock.LockException

            if (!destNode.versionHistory(false).isVersionBelongToThis(version))
               throw new VersionException("Bad version " + version.getPath());

            // Check locking
            if (!destNode.parent().checkLocking())
               throw new LockException("Node " + destNode.getPath() + " is locked ");
         }
         else
         {
            // Dest node not found
            if (!destParent.checkedOut())
View Full Code Here

Examples of javax.jcr.lock.LockException

        VersionManager vMgr = sessionContext.getWorkspace().getVersionManager();
        if (!vMgr.isCheckedOut(absPath)) {
            throw new VersionException("Target node is checked in.");
        }
        if (sessionContext.getWorkspace().getLockManager().isLocked(absPath)) {
            throw new LockException("Target node is locked.");
        }
        ntTypesRoot = root.getTree(NODE_TYPES_PATH);
        accessManager = sessionContext.getAccessManager();
        baseStateIdManager = new IdentifierManager(initialRoot);
        currentStateIdManager = new IdentifierManager(root);
View Full Code Here

Examples of javax.jcr.lock.LockException

                    }
                });
        if (lock != null) {
            return new LockImpl(sessionContext, lock);
        } else {
            throw new LockException("Node " + getPath() + " is not locked");
        }
    }
View Full Code Here

Examples of javax.jcr.lock.LockException

            throws RepositoryException {
        perform(new LockOperation<Void>(sessionDelegate, dlg) {
            @Override
            public Void perform(NodeDelegate node) throws RepositoryException {
                if (node.getStatus() != Status.EXISTING) {
                    throw new LockException(
                            "Unable to lock a node with pending changes");
                }
                node.lock(isDeep);
                String path = node.getPath();
                if (isSessionScoped) {
View Full Code Here

Examples of javax.jcr.lock.LockException

                    sessionContext.getSessionScopedLocks().remove(path);
                    sessionContext.getOpenScopedLocks().remove(path);
                    session.refresh(true);
                    return null;
                } else {
                    throw new LockException("Not an owner of the lock " + path);
                }
            }
        });
    }
View Full Code Here

Examples of javax.jcr.lock.LockException

            PathMap.Element element = lockMap.map(path, false);

            LockInfo other = (LockInfo) element.get();
            if (other != null) {
                if (element.hasPath(path)) {
                    throw new LockException("Node already locked: " + node);
                } else if (other.deep) {
                    throw new LockException(
                            "Parent node has a deep lock: " + node);
                }
            }
            if (info.deep && element.hasPath(path)
                    && element.getChildrenCount() > 0) {
                throw new LockException("Some child node is locked.");
            }

            // create lock token
            info.setLockHolder(session);
            info.setLive(true);
View Full Code Here

Examples of javax.jcr.lock.LockException

        try {
            SessionImpl session = (SessionImpl) node.getSession();
            // check whether node is locked by this session
            PathMap.Element element = lockMap.map(getPath(session, node.getId()), true);
            if (element == null) {
                throw new LockException("Node not locked: " + node);
            }
            AbstractLockInfo info = (AbstractLockInfo) element.get();
            if (info == null) {
                throw new LockException("Node not locked: " + node);
            }
            if (session != info.getLockHolder()) {
                throw new LockException("Node not locked by session: " + node);
            }

            getSessionLockManager(session).lockTokenRemoved(info.getLockToken(session));
           
            element.set(null);
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.