Decision Center API

ilog.rules.teamserver.model
Class BranchHelper

java.lang.Object
  extended by ilog.rules.teamserver.model.BranchHelper

public class BranchHelper
extends Object

BranchHelper handles branch specific operations.


Constructor Summary
BranchHelper()
           
 
Method Summary
static void applyMerge(IlrSession session, List<MergeOperation> mergeOperations, String versionComment)
          Applies the merge operations defined in the list.
protected static void fillDependencies(IlrSession session, IlrBranch branch, Map<String,IlrBranch> sortedDependencies)
           
static List<MergeOperation> getConflicts(List<MergeOperation> mergeOperations)
           
static List<MergeOperation> getLhsAdditions(List<MergeOperation> mergeOperations)
           
protected static IlrBaseline getLhsBranch(List<MergeOperation> mergeOperations)
           
static List<MergeOperation> getLhsDeletions(List<MergeOperation> mergeOperations)
           
static List<MergeOperation> getLhsUpdates(List<MergeOperation> mergeOperations)
           
static List<MergeOperation> getMergeOperations(IlrSession session, IlrBaseline lhsBranch, IlrBaseline rhsBranch)
          Computes the list of differences between two branches.
static Map<IlrBranch,List<MergeOperation>> getMergeOperationsWithDep(IlrSession session, IlrBranch lhsBranch, IlrBranch rhsBranch)
          Computes the list of differences between two branches and their dependencies.
static List<MergeOperation> getRhsAdditions(List<MergeOperation> mergeOperations)
           
protected static IlrBaseline getRhsBranch(List<MergeOperation> mergeOperations)
           
static List<MergeOperation> getRhsDeletions(List<MergeOperation> mergeOperations)
           
static List<MergeOperation> getRhsUpdates(List<MergeOperation> mergeOperations)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BranchHelper

public BranchHelper()
Method Detail

getMergeOperations

public static List<MergeOperation> getMergeOperations(IlrSession session,
                                                      IlrBaseline lhsBranch,
                                                      IlrBaseline rhsBranch)
                                               throws IlrApplicationException
Computes the list of differences between two branches.

Throws:
IlrApplicationException
Parameters:
session - The session.
lhsBranch - The "Left-Hand-Side" branch of the comparison.
rhsBranch - The "Right-Hand-Side" branch of the comparison.
Returns:
The list of differences.

getMergeOperationsWithDep

public static Map<IlrBranch,List<MergeOperation>> getMergeOperationsWithDep(IlrSession session,
                                                                            IlrBranch lhsBranch,
                                                                            IlrBranch rhsBranch)
                                                                     throws IlrApplicationException
Computes the list of differences between two branches and their dependencies. A conflict element is stored for the two branches (lhs and rhs).

Throws:
IlrApplicationException
Parameters:
session - The session.
lhsBranch - The "Left-Hand-Side" branch of the comparison.
rhsBranch - The "Right-Hand-Side" branch of the comparison.
Returns:
The list of differences.

applyMerge

public static void applyMerge(IlrSession session,
                              List<MergeOperation> mergeOperations,
                              String versionComment)
                       throws IlrApplicationException
Applies the merge operations defined in the list. This list of operations is retrieved using the getMergeOperations method. Several operation lists retrieved by different calls to getMergeOperations cannot be mixed and applied using a single call to this method. More specifically, all operations in the list should define the same Left-Hand-Side and Right-Hand-Side branches.

Throws:
IlrApplicationException
Parameters:
session - The session.
mergeOperations - A set of merge operations.
versionComment - A comment that will be used for each new element version created by this method.

getLhsAdditions

public static List<MergeOperation> getLhsAdditions(List<MergeOperation> mergeOperations)
Parameters:
mergeOperations - A set of merge operations.
Returns:
A new list with all additions on the Left-Hand-Side branch.

getLhsDeletions

public static List<MergeOperation> getLhsDeletions(List<MergeOperation> mergeOperations)
Parameters:
mergeOperations - A set of merge operations.
Returns:
A new list with all deletions on the Left-Hand-Side branch.

getLhsUpdates

public static List<MergeOperation> getLhsUpdates(List<MergeOperation> mergeOperations)
Parameters:
mergeOperations - A set of merge operations.
Returns:
A new list with all updates on the Left-Hand-Side branch.

getRhsAdditions

public static List<MergeOperation> getRhsAdditions(List<MergeOperation> mergeOperations)
Parameters:
mergeOperations - A set of merge operations.
Returns:
A new list with all additions on the Right-Hand-Side branch.

getRhsDeletions

public static List<MergeOperation> getRhsDeletions(List<MergeOperation> mergeOperations)
Parameters:
mergeOperations - A set of merge operations.
Returns:
A new list with all deletions on the Right-Hand-Side branch.

getRhsUpdates

public static List<MergeOperation> getRhsUpdates(List<MergeOperation> mergeOperations)
Parameters:
mergeOperations - A set of merge operations.
Returns:
A new list with all updates on the Right-Hand-Side branch.

getConflicts

public static List<MergeOperation> getConflicts(List<MergeOperation> mergeOperations)
Parameters:
mergeOperations - A set of merge operations.
Returns:
A new list with all conflicts between the two branches.

getLhsBranch

protected static IlrBaseline getLhsBranch(List<MergeOperation> mergeOperations)

getRhsBranch

protected static IlrBaseline getRhsBranch(List<MergeOperation> mergeOperations)

fillDependencies

protected static void fillDependencies(IlrSession session,
                                       IlrBranch branch,
                                       Map<String,IlrBranch> sortedDependencies)
                                throws IlrApplicationException
Throws:
IlrApplicationException

Decision Center API

© Copyright IBM Corp. 1987, 2013