Package net.thevpc.naru.ext.tools.plan
Class NaruPlanItem
java.lang.Object
net.thevpc.naru.ext.tools.plan.NaruPlanItem
A single node of a
NaruPlan dependency graph.
Items are addressed by a stable UUID rather than by position, so that reordering or inserting items never invalidates a reference held by a task, a validator, or a persisted session.
-
Constructor Summary
ConstructorsConstructorDescriptionNaruPlanItem(String description) NaruPlanItem(String id, String description) NaruPlanItem(net.thevpc.nuts.elem.NElement element) -
Method Summary
Modifier and TypeMethodDescriptionaddDependency(String itemId) intattempts()How many times this item has been handed to an executor.UUIDs of the items that must beNaruPlanItemStatus.DONEbefore this one becomesNaruPlanItemStatus.READY.booleanid()notes()removeDependency(String itemId) setAttempts(int attempts) setDescription(String description) setStatus(NaruPlanItemStatus status) setValidator(NaruPlanValidatorKind validator) status()taskId()The task spawned to execute this item, if one has been spawned.net.thevpc.nuts.elem.NElement
-
Constructor Details
-
NaruPlanItem
-
NaruPlanItem
-
NaruPlanItem
public NaruPlanItem(net.thevpc.nuts.elem.NElement element)
-
-
Method Details
-
id
-
description
-
setDescription
-
dependsOn
UUIDs of the items that must beNaruPlanItemStatus.DONEbefore this one becomesNaruPlanItemStatus.READY. -
addDependency
-
dependsOn
-
removeDependency
-
status
-
setStatus
-
validator
-
setValidator
-
notes
-
setNotes
-
taskId
The task spawned to execute this item, if one has been spawned.Held as a bare id on purpose: a task is unregistered from the session when it terminates, so a live
NaruTaskreference would dangle exactly when the plan needs to read the outcome. -
setTaskId
-
attempts
public int attempts()How many times this item has been handed to an executor. Guards the retry budget; an item is never re-run automatically once this reaches the caller'smaxAttempts. -
setAttempts
-
incrementAttempts
-
toElement
public net.thevpc.nuts.elem.NElement toElement()
-