Package org.jppf.node.protocol.graph
Class JobDependencyNode
java.lang.Object
org.jppf.node.protocol.graph.JobDependencyNode
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionJobDependencyNode(String id, String jobUuid) Create a new node with the specified id. -
Method Summary
Modifier and TypeMethodDescriptionGet the nodes that depend on this node.Get the dependencies for this node.Get the ids of the dependencies for this node.getDependency(String id) Get the dependency with the specified id.getId()Get the id of this node.Get the JPPF uuid of the associated job.booleanDetermine whether this node has any pending (not completed) dependency.booleanDetermine whether the job represented by this dependency node has been cancelled or should be cancelled when it arrives in the server queue.booleanDetermine whether the job represented by this node has completed.booleanDetermine whether this node is a job dependency graph root.voidsetCancelled(boolean cancelled) voidsetGraphRoot(boolean graphRoot) Specify whether this node is a job dependency graph root.toString()
-
Constructor Details
-
JobDependencyNode
Create a new node with the specified id.- Parameters:
id- the id of this node.jobUuid- the job uuid ornullif the uuid is unknown.
-
-
Method Details
-
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:
trueif there is any pending dependency,falseotherwise.
-
getDependency
Get the dependency with the specified id.- Parameters:
id- the id of the dependency to lookup.- Returns:
- a
JobDependencyNodeinstance this node depends on, ornullif there is no dependency with the specified id.
-
getDependencies
Get the dependencies for this node.- Returns:
- a collection of
JobDependencyNodes, possibly empty.
-
getDependenciesIds
Get the ids of the dependencies for this node.- Returns:
- a set of dpeendency ids, possibly empty.
-
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:
trueif the job has completed,falseotherwise.
-
getJobUuid
Get the JPPF uuid of the associated job.- Returns:
- the job uuid or
nullif the uuid is unknown.
-
isGraphRoot
public boolean isGraphRoot()Determine whether this node is a job dependency graph root.- Returns:
trueif this node is a graph root,falseotherwise.
-
setGraphRoot
public void setGraphRoot(boolean graphRoot) Specify whether this node is a job dependency graph root.- Parameters:
graphRoot-trueto specify that this node is a graph root,falseotherwise.
-
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:
trueif the job has been marked as cancelled,falseotherwise.
-
setCancelled
public void setCancelled(boolean cancelled) - Parameters:
cancelled-trueto cancel the job upon queueing,falseotherwise.
-
toString
-