org.eclipse.emf.emfstore.internal.server.model.versioning.operations.util
Class ChangePackageUtil

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.server.model.versioning.operations.util.ChangePackageUtil

public final class ChangePackageUtil
extends Object

Change package helper class.

Author:
emueller

Method Summary
static int countLeafOperations(AbstractOperation operation)
          Count all leaf operations of a single AbstractOperations.
static int countLeafOperations(Collection<AbstractOperation> operations)
          Count all leaf operations of a collection of AbstractOperations.
static int countLeafOperations(List<AbstractChangePackage> changePackages)
          Count all leaf operations of all operations contained in the given list of ChangePackages.
static int countOperations(List<AbstractChangePackage> changePackages)
          Count all root operations within the given list of ChangePackages.
static AbstractChangePackage createChangePackage(boolean useInMemoryChangePackage)
          Creates a new AbstractChangePackage depending on the client configuration behavior whether to create in-memory of file-based change packages.
static Iterator<ChangePackageEnvelope> splitChangePackage(AbstractChangePackage changePackage, int changePackageFragmentSize)
          Given a single change package, splits it into multiple fragments.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createChangePackage

public static AbstractChangePackage createChangePackage(boolean useInMemoryChangePackage)
Creates a new AbstractChangePackage depending on the client configuration behavior whether to create in-memory of file-based change packages.

Parameters:
useInMemoryChangePackage - whether an in-memory change package should be created
Returns:
the created change package

splitChangePackage

public static Iterator<ChangePackageEnvelope> splitChangePackage(AbstractChangePackage changePackage,
                                                                 int changePackageFragmentSize)
Given a single change package, splits it into multiple fragments.

Parameters:
changePackage - the change package to be splitted
changePackageFragmentSize - the max number of operations a single fragment may consists of
Returns:
an iterator for the created fragments

countLeafOperations

public static int countLeafOperations(Collection<AbstractOperation> operations)
Count all leaf operations of a collection of AbstractOperations.

Parameters:
operations - a collection of operations
Returns:
the leaf operation count of all involved operations

countLeafOperations

public static int countLeafOperations(AbstractOperation operation)
Count all leaf operations of a single AbstractOperations.

Parameters:
operation - a single operation
Returns:
the leaf operation count of the given operation

countLeafOperations

public static int countLeafOperations(List<AbstractChangePackage> changePackages)
Count all leaf operations of all operations contained in the given list of ChangePackages.

Parameters:
changePackages - list of change packages
Returns:
the leaf operation count of all operations contained in the list of change packages

countOperations

public static int countOperations(List<AbstractChangePackage> changePackages)
Count all root operations within the given list of ChangePackages.

Parameters:
changePackages - list of change packages
Returns:
the root operation count of all change packages


Copyright © 2016. All Rights Reserved.