Package javax.jcr

Examples of javax.jcr.InvalidItemStateException


      throws UnsupportedRepositoryOperationException, VersionException, RepositoryException, InvalidItemStateException
   {
      session.checkLive();
      if (session.hasPendingChanges())
      {
         throw new InvalidItemStateException("Session has pending changes ");
      }

      // for restore operation
      List<String> existedIdentifiers = new ArrayList<String>(); // InWorkspace
      List<VersionImpl> notExistedVersions = new ArrayList<VersionImpl>();
View Full Code Here


         ResultSet parent = findItemByIdentifier(caid);
         try
         {
            if (!parent.next())
            {
               throw new InvalidItemStateException("Parent not found, uuid: " + getIdentifier(caid));
            }

            QPathEntry qpe =
               new QPathEntry(InternalQName.parse(parent.getString(COLUMN_NAME)), parent.getInt(COLUMN_INDEX), caid);
            qrpath.add(qpe);
            caid = parent.getString(COLUMN_PARENTID);

            if (caid.equals(parent.getString(COLUMN_ID)))
            {
               throw new InvalidItemStateException("An item with id='" + getIdentifier(caid) + "' is its own parent");
            }
         }
         finally
         {
            try
View Full Code Here

         boolean cpmultivalued = item.getBoolean(COLUMN_PMULTIVALUED);
         return loadPropertyRecord(parentPath, cname, cid, cpid, cversion, cptype, cpmultivalued);
      }
      catch (InvalidItemStateException e)
      {
         throw new InvalidItemStateException("FATAL: Can't build item path for name " + cname + " id: "
            + getIdentifier(cid) + ". " + e);
      }
   }
View Full Code Here

         return pdata;
      }
      catch (InvalidItemStateException e)
      {
         throw new InvalidItemStateException("FATAL: Can't build property path for name " + cname + " id: "
            + getIdentifier(cid) + ". " + e);
      }
      catch (IllegalNameException e)
      {
         throw new RepositoryException(e);
View Full Code Here

        perform(new SessionOperation<Void>() {
            @Override
            public Void perform() throws InvalidItemStateException {
                sessionDelegate.refresh(keepChanges);
                if (!dlg.exists()) {
                    throw new InvalidItemStateException(
                            "This item no longer exists");
                }
                return null;
            }
            @Override
View Full Code Here

    public synchronized void checkAlive() throws RepositoryException {
        sessionDelegate.checkAlive();
        long sessionCount = sessionDelegate.getUpdateCount();
        if (updateCount != sessionCount) {
            if (!exists()) {
                throw new InvalidItemStateException(
                        "This item does not exist anymore : " + getPath());
            }
            updateCount = sessionCount;
        }
    }
View Full Code Here

    @Nonnull
    public PropertyState getPropertyState() throws InvalidItemStateException {
        PropertyState p = parent.getProperty(name);
        if (p == null) {
            throw new InvalidItemStateException();
        }
        return p;
    }
View Full Code Here

        // check for pending changes
        if (sessionDelegate.hasPendingChanges()) {
            String msg = "Unable to perform operation. Session has pending changes.";
            log.debug(msg);
            throw new InvalidItemStateException(msg);
        }

        // TODO
    }
View Full Code Here

                            Constructor<?> excConstr = cl.getConstructor(String.class);
                            if (excConstr != null) {
                                Object o = excConstr.newInstance(msg);
                                if (o instanceof PathNotFoundException && methodCode == DavMethods.DAV_POST) {
                                    // see JCR-2536
                                    return new InvalidItemStateException(msg);
                                } else if (o instanceof RepositoryException) {
                                    return (RepositoryException) o;
                                } else if (o instanceof Exception) {
                                    return new RepositoryException(msg, (Exception)o);
                                }
                            }
                        }
                    }
                }
            } catch (Exception e) {
                return new RepositoryException(e);
            }
        }

        // make sure an exception is generated
        switch (davExc.getErrorCode()) {
            // TODO: mapping DAV_error to jcr-exception is ambiguous. to be improved
            case DavServletResponse.SC_NOT_FOUND :
                switch (methodCode) {
                    case DavMethods.DAV_DELETE:
                    case DavMethods.DAV_MKCOL:
                    case DavMethods.DAV_PUT:
                    case DavMethods.DAV_POST:
                        // target item has probably while transient changes have
                        // been made.
                        return new InvalidItemStateException(msg, davExc);
                    default:
                        return new ItemNotFoundException(msg, davExc);
                }
            case DavServletResponse.SC_LOCKED :
                return new LockException(msg, davExc);
            case DavServletResponse.SC_METHOD_NOT_ALLOWED :
                return new ConstraintViolationException(msg, davExc);
            case DavServletResponse.SC_CONFLICT :
                return new InvalidItemStateException(msg, davExc);
            case DavServletResponse.SC_PRECONDITION_FAILED :
                return new LockException(msg, davExc);
            case DavServletResponse.SC_NOT_IMPLEMENTED:
                if (methodCode > 0 && name != null) {
                    return new UnsupportedRepositoryOperationException(
View Full Code Here

        try {
            childNodeEntries.reload();
        } catch (ItemNotFoundException e) {
            log.debug("NodeEntry does not exist (anymore) -> remove.");
            remove();
            throw new InvalidItemStateException(e);
        }
        return childNodeEntries;
    }
View Full Code Here

TOP

Related Classes of javax.jcr.InvalidItemStateException

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.