Class JobDependencyNode

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

public class JobDependencyNode extends Object implements Serializable
Instances of this class represent a node in the job dependencies graph. They also maintain state information about the job and its dependencies.
Since:
6.2
See Also:
  • Constructor Details

    • JobDependencyNode

      public JobDependencyNode(String id, String jobUuid)
      Create a new node with the specified id.
      Parameters:
      id - the id of this node.
      jobUuid - the job uuid or null if the uuid is unknown.
  • Method Details

    • getId

      public String getId()
      Get the id of this node.
      Returns:
      the node id as a string.
    • hasPendingDependency

      public boolean hasPendingDependency()
      Determine whether this node has any pending (not completed) dependency.
      Returns:
      true if there is any pending dependency, false otherwise.
    • getDependency

      public JobDependencyNode getDependency(String id)
      Get the dependency with the specified id.
      Parameters:
      id - the id of the dependency to lookup.
      Returns:
      a JobDependencyNode instance this node depends on, or null if there is no dependency with the specified id.
    • getDependencies

      public Collection<JobDependencyNode> getDependencies()
      Get the dependencies for this node.
      Returns:
      a collection of JobDependencyNodes, possibly empty.
    • getDependenciesIds

      public Set<String> getDependenciesIds()
      Get the ids of the dependencies for this node.
      Returns:
      a set of dpeendency ids, possibly empty.
    • getDependedOn

      public Collection<JobDependencyNode> getDependedOn()
      Get the nodes that depend on this node.
      Returns:
      a collection of JobDependencyNodes, possibly empty.
    • isCompleted

      public boolean isCompleted()
      Determine whether the job represented by this node has completed.
      Returns:
      true if the job has completed, false otherwise.
    • getJobUuid

      public String getJobUuid()
      Get the JPPF uuid of the associated job.
      Returns:
      the job uuid or null if the uuid is unknown.
    • isGraphRoot

      public boolean isGraphRoot()
      Determine whether this node is a job dependency graph root.
      Returns:
      true if this node is a graph root, false otherwise.
    • setGraphRoot

      public void setGraphRoot(boolean graphRoot)
      Specify whether this node is a job dependency graph root.
      Parameters:
      graphRoot - true to specify that this node is a graph root, false otherwise.
    • isCancelled

      public boolean isCancelled()
      Determine whether the job represented by this dependency node has been cancelled or should be cancelled when it arrives in the server queue.
      Returns:
      true if the job has been marked as cancelled, false otherwise.
    • setCancelled

      public void setCancelled(boolean cancelled)
      Parameters:
      cancelled - true to cancel the job upon queueing, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object