Package org.jppf.node.protocol
Class JobDependencySpec
java.lang.Object
org.jppf.node.protocol.JobDependencySpec
- All Implemented Interfaces:
Serializable
Instances of this class represent the definition of a job and its dependencies.
- Since:
- 6.2
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDependencies(String... dependencies) Add the specified dependencies ot the job.addDependencies(Collection<String> dependencies) Add the specified dependencies ot the job.Get the application-defined ids of the job's dependencies.getId()Get the application-defined id assigned to a job.booleanDetermine whether the job has at least one dependency.booleanDetermine whether cancelling the job triggers the cancellation of all the jobs that depend on it.booleanDetermine whether the job is a root in the dependency graph it and its dependencies should be removed from the graph upon completetion.setCascadeCancellation(boolean cascadeCancellation) Specify whether cancelling the job triggers the cancellation of all the jobs that depend on it.setGraphRoot(boolean graphRoot) Specify whether the job is a root in the dependency graph, implying that it and its dependencies should be removed from the graph upon completetion.Set the dependency id for the current job.toString()
-
Constructor Details
-
JobDependencySpec
public JobDependencySpec()Initialize this dependencies specification.
-
-
Method Details
-
getId
Get the application-defined id assigned to a job.- Returns:
- the id string.
-
setId
Set the dependency id for the current job.- Parameters:
id- the id of the dependency to add.- Returns:
- this
JobDependencySpec, for method call chaining.
-
getDependencies
Get the application-defined ids of the job's dependencies.- Returns:
- an array of string ids.
-
addDependencies
Add the specified dependencies ot the job. Null dependencies in the input array are ignored.- Parameters:
dependencies- the dependencie to add.- Returns:
- this
JobDependencySpec, for method call chaining.
-
addDependencies
Add the specified dependencies ot the job. Null dependencies in the input collection are ignored.- Parameters:
dependencies- the dependencie to add.- Returns:
- this
JobDependencySpec, for method call chaining.
-
isGraphRoot
public boolean isGraphRoot()Determine whether the job is a root in the dependency graph it and its dependencies should be removed from the graph upon completetion. This method returnsfalseby default, unlesssetRemoveUponCompletion(true)was called before.- Returns:
trueif the job is a root in the dependency graph and should be removed from the graph after completion,falseotherwise.
-
setGraphRoot
Specify whether the job is a root in the dependency graph, implying that it and its dependencies should be removed from the graph upon completetion. For all practical purposes, this method should only be called for roots in a job dependency graph, that is, for jobs upon which no other job depends.- Parameters:
graphRoot-trueif the job is a root in the dependency graph and should be removed from the graph after completion,falseotherwise.- Returns:
- this
JobDependencySpec, for method call chaining.
-
hasDependency
public boolean hasDependency()Determine whether the job has at least one dependency.- Returns:
trueif the job has one or more dependencies,falseotherwise.
-
isCascadeCancellation
public boolean isCascadeCancellation()Determine whether cancelling the job triggers the cancellation of all the jobs that depend on it. This method returnstrueby default, unlesssetCascadeCancellation(false)was called before.- Returns:
trueif the cancellation of the job is propagated to the jobs that depend on it,falseotherwise.
-
setCascadeCancellation
Specify whether cancelling the job triggers the cancellation of all the jobs that depend on it.- Parameters:
cascadeCancellation-trueto propagate the cancellation of the job to the jobs that depend on it,falseotherwise.- Returns:
- this
JobDependencySpec, for method call chaining.
-
toString
-