org.cip4.jdflib.util
Class JDFMerge

java.lang.Object
  extended by org.cip4.jdflib.util.JDFMerge

public class JDFMerge
extends Object

Author:
Rainer Prosi This class is used when merging a JDF node it summarizes all merging routines the had been part of JDF Node

Field Summary
 boolean bAddMergeToProcessRun
          set this to true if you want to update the ProcessRun(s) timestamps for this merge
 boolean bUpdateStati
          set this to true if you want to update the stati of the relevant parent nodes based on the new Stati of the merged node
 
Constructor Summary
JDFMerge(JDFNode parentNode)
           
 
Method Summary
protected  void findSpawnAudit()
           
 JDFResource.EnumAmountMerge getAmountPolicy()
           
 JDFNode.EnumCleanUpMerge getCleanPolicy()
           
 JDFNode mergeJDF(JDFNode _toMerge)
          merge a previously spawned JDF into a node that is a child of, or this root
 JDFNode mergeJDF(JDFNode _toMerge, String urlMerge, JDFNode.EnumCleanUpMerge cleanPolicy, JDFResource.EnumAmountMerge amountPolicy)
          merge a previously spawned JDF into a node that is a child of, or this root default: mergeJDF(subJDFNode, null, JDFNode.EnumCleanUpMerge.None, JDFResource.EnumAmountMerge.None)
protected  void mergeLocalResourcePool(JDFNode overwriteLocalNode, JDFNode toMergeLocalNode)
           
static JDFResource mergePartition(JDFResource targetRes, JDFResource resToMerge, String spawnID, JDFResource.EnumAmountMerge amountPolicy, boolean bLocalResource)
          Merges partitioned resources into this resource uses PartIDKey to identify the correct resources
protected  void remergeAuditPools()
           
 JDFNode remergeJDF(JDFNode _toMerge)
          merge a previously spawned and previously merged JDF into a node that is a child of, or this root
 void setAmountPolicy(JDFResource.EnumAmountMerge amountPolicy)
           
 void setCleanPolicy(JDFNode.EnumCleanUpMerge cleanPolicy)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bUpdateStati

public boolean bUpdateStati
set this to true if you want to update the stati of the relevant parent nodes based on the new Stati of the merged node


bAddMergeToProcessRun

public boolean bAddMergeToProcessRun
set this to true if you want to update the ProcessRun(s) timestamps for this merge

Constructor Detail

JDFMerge

public JDFMerge(JDFNode parentNode)
Parameters:
parentNode - the parent node to merge into. MAY be the actual node to be replace or any Parent thereof
Method Detail

mergeJDF

public JDFNode mergeJDF(JDFNode _toMerge,
                        String urlMerge,
                        JDFNode.EnumCleanUpMerge cleanPolicy,
                        JDFResource.EnumAmountMerge amountPolicy)
merge a previously spawned JDF into a node that is a child of, or this root

default: mergeJDF(subJDFNode, null, JDFNode.EnumCleanUpMerge.None, JDFResource.EnumAmountMerge.None)

Parameters:
_toMerge - the previously spawned jdf node
urlMerge - the url of the ???
cleanPolicy - policy how to clean up the spawn and merge audits after merging
amountPolicy - policy how to clean up the Resource amounts after merging
Returns:
JDFNode - the merged node in the new document
note that the return value used to be boolean. The boolean value is now replaced by exceptions. This corresponds to true always.
Throws:
JDFException - if subJDFNode has already been merged
JDFException - if subJDFNode was not spawned from this
JDFException - if subJDFNode has no AncestorPool default: mergeJDF(subJDFNode, null, JDFNode.EnumCleanUpMerge.None, JDFResource.EnumAmountMerge.None)

mergeJDF

public JDFNode mergeJDF(JDFNode _toMerge)
merge a previously spawned JDF into a node that is a child of, or this root

Parameters:
_toMerge - the previously spawned jdf node
Returns:
JDFNode - the merged node in the new document
note that the return value used to be boolean. The boolean value is now replaced by exceptions. This corresponds to true always.
Throws:
JDFException - if subJDFNode has already been merged
JDFException - if subJDFNode was not spawned from this
JDFException - if subJDFNode has no AncestorPool

remergeJDF

public JDFNode remergeJDF(JDFNode _toMerge)
merge a previously spawned and previously merged JDF into a node that is a child of, or this root

Parameters:
_toMerge - the previously spawned jdf node
Returns:
JDFNode - the merged node in the new document
note that the return value used to be boolean. The boolean value is now replaced by exceptions. This corresponds to true always.
Throws:
JDFException - if subJDFNode has no AncestorPool

remergeAuditPools

protected void remergeAuditPools()

findSpawnAudit

protected void findSpawnAudit()

mergeLocalResourcePool

protected void mergeLocalResourcePool(JDFNode overwriteLocalNode,
                                      JDFNode toMergeLocalNode)

mergePartition

public static JDFResource mergePartition(JDFResource targetRes,
                                         JDFResource resToMerge,
                                         String spawnID,
                                         JDFResource.EnumAmountMerge amountPolicy,
                                         boolean bLocalResource)
Merges partitioned resources into this resource uses PartIDKey to identify the correct resources

Parameters:
targetRes -
resToMerge - the resource leaf to merge into this
spawnID - the spawnID of the spawning that will now be merged
amountPolicy - how to clean up the Resource amounts after merging
bLocalResource - must be true for the local resources in a spawned node and its subnodes, which default to RW
Returns:
Throws:
JDFException - if here is an attempt to merge incompatible resources
JDFException - if here is an attempt to merge incompatible partitions

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getCleanPolicy

public JDFNode.EnumCleanUpMerge getCleanPolicy()
Returns:

setCleanPolicy

public void setCleanPolicy(JDFNode.EnumCleanUpMerge cleanPolicy)
Parameters:
cleanPolicy -

getAmountPolicy

public JDFResource.EnumAmountMerge getAmountPolicy()
Returns:

setAmountPolicy

public void setAmountPolicy(JDFResource.EnumAmountMerge amountPolicy)
Parameters:
amountPolicy -


Copyright © 2013. All Rights Reserved.