Examples of TransactionChangesLog


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

         LOG.debug("tx start() " + this + " txStarted(): " + txStarted());
      }

      if (!txStarted())
      {
         transactionLog = new TransactionChangesLog();
      }
   }
View Full Code Here

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

         transactionLog.addLog(statesLog);
      }
      else
      {
         // Regular save
         storageDataManager.save(new TransactionChangesLog(statesLog));
      }

   }
View Full Code Here

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

               .generate(), -1, PropertyType.NAME, rootNode.getIdentifier(), false,
               new TransientValueData(rootNodeType));
         changesLog.add(new ItemState(primaryType, ItemState.ADDED, false, null)); //
      }

      dataManager.save(new TransactionChangesLog(changesLog));
      return rootNode;
   }
View Full Code Here

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

      changesLog.add(ItemState.createAddedState(vsPrimaryType));
      changesLog.add(ItemState.createAddedState(exoMixinTypes));
      changesLog.add(ItemState.createAddedState(exoPerms));
      changesLog.add(new ItemState(versionStorageNodeData, ItemState.MIXIN_CHANGED, false, null));

      dataManager.save(new TransactionChangesLog(changesLog));

      return jcrSystem;
   }
View Full Code Here

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

   public void save(final CompositeChangesLog changesLog) throws RepositoryException, InvalidItemStateException
   {

      final ChangesLogIterator logIterator = changesLog.getLogIterator();

      final TransactionChangesLog versionLogs = new TransactionChangesLog();
      final TransactionChangesLog nonVersionLogs = new TransactionChangesLog();

      while (logIterator.hasNextLog())
      {
         List<ItemState> vstates = new ArrayList<ItemState>();
         List<ItemState> nvstates = new ArrayList<ItemState>();

         PlainChangesLog changes = logIterator.nextLog();
         for (ItemState change : changes.getAllStates())
         {
            if (isSystemDescendant(change.getData().getQPath()) && !this.equals(versionDataManager))
            {
               vstates.add(change);
            }
            else
            {
               nvstates.add(change);
            }
         }

         if (vstates.size() > 0)
         {
            if (nvstates.size() > 0)
            {
               // we have pair of logs for system and non-system (this) workspaces
               final String pairId = IdGenerator.generate();

               versionLogs.addLog(PlainChangesLogImpl.createCopy(vstates, pairId, changes));
               nonVersionLogs.addLog(PlainChangesLogImpl.createCopy(nvstates, pairId, changes));
            }
            else
            {
               versionLogs.addLog(PlainChangesLogImpl.createCopy(vstates, changes));
               nonVersionLogs.addLog(PlainChangesLogImpl.createCopy(nvstates, changes));
            }
         }
         else if (nvstates.size() > 0)
         {
            nonVersionLogs.addLog(PlainChangesLogImpl.createCopy(nvstates, changes));
         }
      }

      if (versionLogs.getSize() > 0)
      {
         versionDataManager.save(versionLogs, txResourceManager);
      }

      if (nonVersionLogs.getSize() > 0)
      {
         super.save(nonVersionLogs);
      }
   }
View Full Code Here

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

   @Override
   protected void save(ItemStateChangesLog persistentLog) throws IOException
   {

      TransactionChangesLog changesLog = (TransactionChangesLog)persistentLog;

      if (changesLog != null && !isSessionNull(changesLog))
      {
         long start = System.currentTimeMillis();

         writeExternal(oosFileData, changesLog, fileCleaner);

         long total = System.currentTimeMillis() - start;

         if (LOG.isDebugEnabled())
            LOG.debug("Time : " + total + " ms" + "    Itemstates count : " + changesLog.getAllStates().size());
      }
   }
View Full Code Here

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

                     for (ChangesFile fileDescriptor : fileDescriptorList)
                     {
                        try
                        {
                           TransactionChangesLog transactionChangesLog =
                              recoveryReader.getChangesLog(PrivilegedFileHelper.getAbsolutePath(fileDescriptor.getFile()));

                           transactionChangesLog.setSystemId(fileDescriptor.getSystemId());

                           Calendar cLogTime = fileNameFactory.getDateFromFileName(fileDescriptor.getFile().getName());

                           if (log.isDebugEnabled())
                           {
                              log.debug("Save to JCR : "
                                 + PrivilegedFileHelper.getAbsolutePath(fileDescriptor.getFile()));
                              log.debug("SystemID : " + transactionChangesLog.getSystemId());
                              log.debug("list size : " + fileDescriptorList.size());
                           }

                           // dump log
                           if (log.isDebugEnabled())
                           {
                              ChangesLogIterator logIterator = transactionChangesLog.getLogIterator();
                              while (logIterator.hasNextLog())
                              {
                                 PlainChangesLog pcl = logIterator.nextLog();
                                 log.debug(pcl.dump());
                              }
                           }

                           saveChangesLog(dataKeeper, transactionChangesLog, cLogTime);

                           if (log.isDebugEnabled())
                           {
                              log.debug("After save message: the owner systemId --> "
                                 + transactionChangesLog.getSystemId());
                              log.debug("After save message: --> " + systemId);
                           }

                        }
                        catch (Exception e)
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(dataManager, normalizeChangesLog, cLogTime);
         }
      }
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 = new PlainChangesLogImpl(normalized, next.getSessionId(), next.getEventType());
            result.addLog(plog);
         }

         return result;
      }
View Full Code Here

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

   {

      ObjectReaderImpl in = new ObjectReaderImpl(PrivilegedFileHelper.fileInputStream(filePath));
      TransactionChangesLogReader rdr = new TransactionChangesLogReader(fileCleaner, maxBufferSize, holder);

      TransactionChangesLog tcl;
      try
      {
         tcl = rdr.read(in);
      }
      catch (UnknownClassIdException 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.