Package org.cip4.jdflib.util
Class JDFMerge
- java.lang.Object
-
- org.cip4.jdflib.util.JDFMerge
-
public class JDFMerge extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description booleanbAddMergeToProcessRunset this to true if you want to update the ProcessRun(s) timestamps for this mergebooleanbUpdateStatiset this to true if you want to update the stati of the relevant parent nodes based on the new Stati of the merged node
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JDFResource.EnumAmountMergegetAmountPolicy()JDFNode.EnumCleanUpMergegetCleanPolicy()JDFNodemergeJDF(JDFNode _toMerge)merge a previously spawned JDF into a node that is a child of, or this rootJDFNodemergeJDF(JDFNode _toMerge, java.lang.String urlMerge, JDFNode.EnumCleanUpMerge cleanPolicy, JDFResource.EnumAmountMerge amountPolicy)merge a previously spawned JDF into a node that is a child of, or this rootprotected voidmergeLocalResourcePool(JDFNode overwriteLocalNode, JDFNode toMergeLocalNode)static JDFResourcemergePartition(JDFResource targetRes, JDFResource toMerge, java.lang.String spawnID, JDFResource.EnumAmountMerge amountPolicy, boolean bLocalResource)Merges partitioned resources into this resource uses PartIDKey to identify the correct resourcesprotected voidremergeAuditPools()JDFNoderemergeJDF(JDFNode _toMerge)merge a previously spawned and previously merged JDF into a node that is a child of, or this rootvoidsetAmountPolicy(JDFResource.EnumAmountMerge amountPolicy)voidsetCleanPolicy(JDFNode.EnumCleanUpMerge cleanPolicy)java.lang.StringtoString()
-
-
-
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, java.lang.String urlMerge, JDFNode.EnumCleanUpMerge cleanPolicy, JDFResource.EnumAmountMerge amountPolicy)
merge a previously spawned JDF into a node that is a child of, or this rootdefault: mergeJDF(subJDFNode, null, JDFNode.EnumCleanUpMerge.None, JDFResource.EnumAmountMerge.None)
- Parameters:
_toMerge- the previously spawned jdf nodeurlMerge- the url of the ???cleanPolicy- policy how to clean up the spawn and merge audits after mergingamountPolicy- 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 totruealways. - Throws:
JDFException- if subJDFNode has already been mergedJDFException- if subJDFNode was not spawned from thisJDFException- 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 totruealways. - Throws:
JDFException- if subJDFNode has already been mergedJDFException- if subJDFNode was not spawned from thisJDFException- 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 totruealways. - Throws:
JDFException- if subJDFNode has no AncestorPool
-
remergeAuditPools
protected void remergeAuditPools()
-
mergeLocalResourcePool
protected void mergeLocalResourcePool(JDFNode overwriteLocalNode, JDFNode toMergeLocalNode)
-
mergePartition
public static JDFResource mergePartition(JDFResource targetRes, JDFResource toMerge, java.lang.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 thisspawnID- the spawnID of the spawning that will now be mergedamountPolicy- how to clean up the Resource amounts after mergingbLocalResource- 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 resourcesJDFException- if here is an attempt to merge incompatible partitions
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.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-
-
-