Class JobDependencySpec

java.lang.Object
org.jppf.node.protocol.JobDependencySpec
All Implemented Interfaces:
Serializable

public class JobDependencySpec extends Object implements Serializable
Instances of this class represent the definition of a job and its dependencies.
Since:
6.2
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • JobDependencySpec

      public JobDependencySpec()
      Initialize this dependencies specification.
  • Method Details

    • getId

      public String getId()
      Get the application-defined id assigned to a job.
      Returns:
      the id string.
    • setId

      public JobDependencySpec setId(String id)
      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

      public List<String> getDependencies()
      Get the application-defined ids of the job's dependencies.
      Returns:
      an array of string ids.
    • addDependencies

      public JobDependencySpec addDependencies(String... dependencies)
      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

      public JobDependencySpec addDependencies(Collection<String> dependencies)
      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 returns false by default, unless setRemoveUponCompletion(true) was called before.
      Returns:
      true if the job is a root in the dependency graph and should be removed from the graph after completion, false otherwise.
    • setGraphRoot

      public JobDependencySpec 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. 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 - true if the job is a root in the dependency graph and should be removed from the graph after completion, false otherwise.
      Returns:
      this JobDependencySpec, for method call chaining.
    • hasDependency

      public boolean hasDependency()
      Determine whether the job has at least one dependency.
      Returns:
      true if the job has one or more dependencies, false otherwise.
    • isCascadeCancellation

      public boolean isCascadeCancellation()
      Determine whether cancelling the job triggers the cancellation of all the jobs that depend on it. This method returns true by default, unless setCascadeCancellation(false) was called before.
      Returns:
      true if the cancellation of the job is propagated to the jobs that depend on it, false otherwise.
    • setCascadeCancellation

      public JobDependencySpec setCascadeCancellation(boolean cascadeCancellation)
      Specify whether cancelling the job triggers the cancellation of all the jobs that depend on it.
      Parameters:
      cascadeCancellation - true to propagate the cancellation of the job to the jobs that depend on it, false otherwise.
      Returns:
      this JobDependencySpec, for method call chaining.
    • toString

      public String toString()
      Overrides:
      toString in class Object