Package org.exoplatform.services.jcr.impl.storage

Examples of org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateException


         }
        
         // then update type
         if (updatePropertyByIdentifier(data.getPersistedVersion(), data.getType(), cid) <= 0)
         {
            throw new JCRInvalidItemStateException("(update) Property not found " + data.getQPath().getAsString() + " "
               + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
               ItemState.UPDATED);
         }

         // update reference
View Full Code Here


                     ItemData data = getCurrentItem(currentChange, i, FAKE_NODE);
                     if (data == FAKE_NODE)
                     {
                        throw new RepositoryException("Current item cannot be found");                          
                     }
                     throw new JCRInvalidItemStateException("(delete) " + (data.isNode() ? "Node" : "Property")+ " not found "
                        + data.getQPath().getAsString() + " " + data.getIdentifier()
                        + ". Probably was deleted by another session ", data.getIdentifier(), ItemState.DELETED);
                  }
               }
            }
            // Update commands
            if ((currentChangeStatus & TYPE_UPDATE_REFERENCE) > 0)
            {
               currentChange = TYPE_UPDATE_REFERENCE;
               updateReference.executeBatch();
            }
            if ((currentChangeStatus & TYPE_UPDATE_VALUE) > 0)
            {
               currentChange = TYPE_UPDATE_VALUE;
               updateValue.executeBatch();
            }
            if ((currentChangeStatus & TYPE_UPDATE_PROPERTY) > 0)
            {
               currentChange = TYPE_UPDATE_PROPERTY;
               int[] results = updateProperty.executeBatch();
               for (int i = 0; i < results.length; i++)
               {
                  if (results[i] == 0)
                  {
                     ItemData data = getCurrentItem(currentChange, i, FAKE_PROPERTY);
                     if (data == FAKE_PROPERTY)
                     {
                        throw new RepositoryException("Current item cannot be found");                          
                     }
                     throw new JCRInvalidItemStateException("(update) Property not found " + data.getQPath().getAsString() + " "
                              + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
                              ItemState.UPDATED);
                  }
               }
            }
            if ((currentChangeStatus & TYPE_UPDATE_NODE) > 0)
            {
               currentChange = TYPE_UPDATE_NODE;
               int[] results = updateNode.executeBatch();
               for (int i = 0; i < results.length; i++)
               {
                  if (results[i] == 0)
                  {
                     ItemData data = getCurrentItem(currentChange, i, FAKE_NODE);
                     if (data == FAKE_NODE)
                     {
                        throw new RepositoryException("Current item cannot be found");                          
                     }
                     throw new JCRInvalidItemStateException("(update) Node not found " + data.getQPath().getAsString() + " "
                              + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
                              ItemState.UPDATED);
                  }
               }
            }
            // Rename commands
            if ((currentChangeStatus & TYPE_RENAME_NODE) > 0)
            {
               currentChange = TYPE_RENAME_NODE;
               int[] results = renameNode.executeBatch();
               for (int i = 0; i < results.length; i++)
               {
                  if (results[i] == 0)
                  {
                     ItemData data = getCurrentItem(currentChange, i, FAKE_NODE);
                     if (data == FAKE_NODE)
                     {
                        throw new RepositoryException("Current item cannot be found");                          
                     }
                     throw new JCRInvalidItemStateException("(rename) Node not found " + data.getQPath().getAsString() + " "
                              + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
                              ItemState.RENAMED);
                  }
               }
            }
View Full Code Here

      checkIfOpened();
      try
      {
         if (renameNode(data) <= 0)
         {
            throw new JCRInvalidItemStateException("(rename) Node not found " + data.getQPath().getAsString() + " "
               + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
               ItemState.RENAMED);
         }
      }
      catch (SQLException e)
View Full Code Here

      try
      {
         int nc = deleteItemByIdentifier(cid);
         if (nc <= 0)
         {
            throw new JCRInvalidItemStateException("(delete) Node not found " + data.getQPath().getAsString() + " "
               + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
               ItemState.DELETED);
         }

         if (LOG.isDebugEnabled())
View Full Code Here

         // delete item
         int nc = deleteItemByIdentifier(cid);
         if (nc <= 0)
         {
            throw new JCRInvalidItemStateException("(delete) Property not found " + data.getQPath().getAsString() + " "
               + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
               ItemState.DELETED);
         }

         if (LOG.isDebugEnabled())
View Full Code Here

      {
         String cid = getInternalId(data.getIdentifier());
         // order numb update
         if (updateNodeByIdentifier(data.getPersistedVersion(), data.getQPath().getIndex(), data.getOrderNumber(), cid) <= 0)
         {
            throw new JCRInvalidItemStateException("(update) Node not found " + data.getQPath().getAsString() + " "
               + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
               ItemState.UPDATED);
         }

         if (LOG.isDebugEnabled())
View Full Code Here

         String cid = getInternalId(data.getIdentifier());

         // update type
         if (updatePropertyByIdentifier(data.getPersistedVersion(), data.getType(), cid) <= 0)
         {
            throw new JCRInvalidItemStateException("(update) Property not found " + data.getQPath().getAsString() + " "
               + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
               ItemState.UPDATED);
         }

         // update reference
View Full Code Here

      checkIfOpened();
      try
      {
         if (renameNode(data) <= 0)
         {
            throw new JCRInvalidItemStateException("(rename) Node not found " + data.getQPath().getAsString() + " "
               + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
               ItemState.RENAMED);
         }
      }
      catch (SQLException e)
View Full Code Here

      try
      {
         int nc = deleteItemByIdentifier(cid);
         if (nc <= 0)
         {
            throw new JCRInvalidItemStateException("(delete) Node not found " + data.getQPath().getAsString() + " "
               + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
               ItemState.DELETED);
         }

         if (LOG.isDebugEnabled())
View Full Code Here

         // delete item
         int nc = deleteItemByIdentifier(cid);
         if (nc <= 0)
         {
            throw new JCRInvalidItemStateException("(delete) Property not found " + data.getQPath().getAsString() + " "
               + data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
               ItemState.DELETED);
         }

         if (LOG.isDebugEnabled())
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateException

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.