Class DAGNode<DataT,NodeT extends DAGNode<DataT,NodeT>>
java.lang.Object
com.microsoft.azure.management.resources.fluentcore.dag.Node<DataT,NodeT>
com.microsoft.azure.management.resources.fluentcore.dag.DAGNode<DataT,NodeT>
- Type Parameters:
DataT
- the type of the data stored in the nodeNodeT
- the type of the node
The type representing node in a
DAGraph
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDependency
(String dependencyKey) Mark the node identified by the given key as this node's dependency.void
addDependent
(String key) Mark the node identified by the given key as dependent of this node.boolean
void
Initialize the node so that traversal can be performed on the parent DAG.boolean
lock()
protected void
onFaultedResolution
(String dependencyKey, Throwable throwable) Reports a dependency of this node has been faulted.protected void
onSuccessfulResolution
(String dependencyKey) Reports a dependency of this node has been successfully resolved.void
removeDependency
(String dependencyKey) Remove the dependency node identified by the given key from the dependencies.void
setPreparer
(boolean isPreparer) Mark or un-mark this node as preparer.Methods inherited from class com.microsoft.azure.management.resources.fluentcore.dag.Node
addChild, children, data, hasChildren, key, owner, removeChild, setOwner
-
Constructor Details
-
DAGNode
Creates a DAG node.- Parameters:
key
- unique id of the nodedata
- data to be stored in the node
-
-
Method Details
-
lock
- Returns:
- the lock to be used while performing thread safe operation on this node.
-
addDependent
Mark the node identified by the given key as dependent of this node.- Parameters:
key
- the id of the dependent node
-
dependencyKeys
- Returns:
- a list of keys of nodes in
DAGraph
that this node depends on
-
addDependency
Mark the node identified by the given key as this node's dependency.- Parameters:
dependencyKey
- the id of the dependency node
-
removeDependency
Remove the dependency node identified by the given key from the dependencies.- Parameters:
dependencyKey
- the id of the dependency node
-
hasDependencies
public boolean hasDependencies()- Returns:
- true if this node has any dependency
-
setPreparer
public void setPreparer(boolean isPreparer) Mark or un-mark this node as preparer.- Parameters:
isPreparer
- true if this node needs to be marked as preparer, false otherwise.
-
isPreparer
public boolean isPreparer()- Returns:
- true if this node is marked as preparer
-
initialize
public void initialize()Initialize the node so that traversal can be performed on the parent DAG. -
onSuccessfulResolution
Reports a dependency of this node has been successfully resolved.- Parameters:
dependencyKey
- the id of the dependency node
-
onFaultedResolution
Reports a dependency of this node has been faulted.- Parameters:
dependencyKey
- the id of the dependency nodethrowable
- the reason for unsuccessful resolution
-