Examples of TransactionChangesLog


Examples of org.exoplatform.services.jcr.dataflow.TransactionChangesLog

         if (lockOwner == null && lockIsDeep == null)
         {
            return;
         }

         dataManager.save(new TransactionChangesLog(changesLog));
      }
      catch (JCRInvalidItemStateException e)
      {
         //Skip property not found in DB, because that lock property was removed in other node of cluster.
         if (LOG.isDebugEnabled())
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.TransactionChangesLog

    */
   protected void doRestore() throws Throwable
   {
      PlainChangesLog changes = read();

      TransactionChangesLog tLog = new TransactionChangesLog(changes);
      tLog.setSystemId(Constants.JCR_CORE_RESTORE_WORKSPACE_INITIALIZER_SYSTEM_ID); // mark changes

      dataManager.save(tLog);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.TransactionChangesLog

         changesLog.add(ItemState.createDeletedState(lockIsDeep));

         // lock probably removed by other thread
         if (lockOwner == null && lockIsDeep == null)
            return;
         dataManager.save(new TransactionChangesLog(changesLog));
      }
      catch (RepositoryException e)
      {
         log.error("Error occur during removing lock" + e.getLocalizedMessage());
      }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.TransactionChangesLog

      {
         ois = new ObjectInputStream(PrivilegedFileHelper.fileInputStream(incrementalBackupFile));

         while (true)
         {
            TransactionChangesLog changesLog = readExternal(ois);
            changesLog.setSystemId(Constants.JCR_CORE_RESTORE_WORKSPACE_INITIALIZER_SYSTEM_ID); // mark changes

            ChangesLogIterator cli = changesLog.getLogIterator();
            while (cli.hasNextLog())
            {
               if (cli.nextLog().getEventType() == ExtendedEvent.LOCK)
               {
                  cli.removeLog();
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.TransactionChangesLog

      {
         dataManager.save(changesLog);
      }
      catch (JCRInvalidItemStateException e)
      {
         TransactionChangesLog normalizeChangesLog =
            getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
         if (normalizeChangesLog != null)
         {
            saveChangesLog(normalizeChangesLog);
         }
         else
         {
            throw new RepositoryException(
               "Collisions found during save of restore changes log, but caused item is not found by ID "
                  + e.getIdentifier() + ". " + e, e);
         }
      }
      catch (JCRItemExistsException e)
      {
         TransactionChangesLog normalizeChangesLog =
            getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
         if (normalizeChangesLog != null)
         {
            saveChangesLog(normalizeChangesLog);
         }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.TransactionChangesLog

      ItemState citem = changesLog.getItemState(collisionID);

      if (citem != null)
      {

         TransactionChangesLog result = new TransactionChangesLog();
         result.setSystemId(changesLog.getSystemId());

         ChangesLogIterator cli = changesLog.getLogIterator();
         while (cli.hasNextLog())
         {
            ArrayList<ItemState> normalized = new ArrayList<ItemState>();
            PlainChangesLog next = cli.nextLog();
            for (ItemState change : next.getAllStates())
            {
               if (state == change.getState())
               {
                  ItemData item = change.getData();
                  // targeted state
                  if (citem.isNode())
                  {
                     // Node... by ID and desc path
                     if (!item.getIdentifier().equals(collisionID)
                        && !item.getQPath().isDescendantOf(citem.getData().getQPath()))
                     {
                        normalized.add(change);
                     }
                  }
                  else if (!item.getIdentifier().equals(collisionID))
                  {
                     // Property... by ID
                     normalized.add(change);
                  }
               }
               else
               {
                  // another state
                  normalized.add(change);
               }
            }

            PlainChangesLog plog = PlainChangesLogImpl.createCopy(normalized, next);
            result.addLog(plog);
         }

         return result;
      }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.TransactionChangesLog

   private TransactionChangesLog readExternal(ObjectInputStream in) throws IOException, ClassNotFoundException
   {
      int changesLogType = in.readInt();

      TransactionChangesLog transactionChangesLog = null;

      if (changesLogType == RestoreChangesLog.Type.ItemDataChangesLog_with_Streams)
      {

         // read ChangesLog
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.TransactionChangesLog

         {
            persistedLog = persister.save((PlainChangesLogImpl)changesLog);
         }
         else if (changesLog instanceof TransactionChangesLog)
         {
            TransactionChangesLog orig = (TransactionChangesLog)changesLog;

            TransactionChangesLog persisted = new TransactionChangesLog();
            persisted.setSystemId(orig.getSystemId());

            for (ChangesLogIterator iter = orig.getLogIterator(); iter.hasNextLog();)
            {
               persisted.addLog(persister.save(iter.nextLog()));
            }

            persistedLog = persisted;
         }
         else
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.TransactionChangesLog

   public void save(ItemStateChangesLog changesLog) throws InvalidItemStateException, UnsupportedOperationException,
      RepositoryException
   {

      ChangesLogIterator logIterator = ((CompositeChangesLog)changesLog).getLogIterator();
      TransactionChangesLog newLog = new TransactionChangesLog();

      while (logIterator.hasNextLog())
      {
         List<ItemState> states = new ArrayList<ItemState>(changesLog.getSize());
         PlainChangesLog changes = logIterator.nextLog();
         for (ItemState change : changes.getAllStates())
         {
            states.add(new ItemState(copyItemData(change.getData()), change.getState(), change.isEventFire(), change
               .getAncestorToSave(), change.isInternallyCreated(), change.isPersisted(), change.getOldPath()));
         }

         newLog.addLog(PlainChangesLogImpl.createCopy(states, changes));
      }

      storageDataManager.save(newLog);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.TransactionChangesLog

            }
            return;
         }
         try
         {
            TransactionChangesLog allChanges = new TransactionChangesLog();
            for (Map.Entry<PlainChangesLog, SessionImpl> entry : changes.entrySet())
            {
               SessionImpl session = entry.getValue();
               // first check if the tx was not too long
               if (session.hasExpired())
               {
                  // at least one session has expired so we abort the tx
                  throw new RepositoryException("The tx was too long, at least one session has expired.");
               }
               // Add the change following the chronology order
               allChanges.addLog(entry.getKey());
            }
            getWorkspaceDataManager().save(allChanges);
         }
         catch (RepositoryException e)
         {
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.