Class NaruPlanItem

java.lang.Object
net.thevpc.naru.ext.tools.plan.NaruPlanItem

public class NaruPlanItem extends Object
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 Details

    • NaruPlanItem

      public NaruPlanItem(String description)
    • NaruPlanItem

      public NaruPlanItem(String id, String description)
    • NaruPlanItem

      public NaruPlanItem(net.thevpc.nuts.elem.NElement element)
  • Method Details

    • id

      public String id()
    • description

      public String description()
    • setDescription

      public NaruPlanItem setDescription(String description)
    • dependsOn

      public List<String> dependsOn()
      UUIDs of the items that must be NaruPlanItemStatus.DONE before this one becomes NaruPlanItemStatus.READY.
    • addDependency

      public NaruPlanItem addDependency(String itemId)
    • dependsOn

      public boolean dependsOn(String itemId)
    • removeDependency

      public NaruPlanItem removeDependency(String itemId)
    • status

      public NaruPlanItemStatus status()
    • setStatus

      public NaruPlanItem setStatus(NaruPlanItemStatus status)
    • validator

      public NaruPlanValidatorKind validator()
    • setValidator

      public NaruPlanItem setValidator(NaruPlanValidatorKind validator)
    • notes

      public String notes()
    • setNotes

      public NaruPlanItem setNotes(String notes)
    • taskId

      public Long 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 NaruTask reference would dangle exactly when the plan needs to read the outcome.

    • setTaskId

      public NaruPlanItem setTaskId(Long taskId)
    • 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's maxAttempts.
    • setAttempts

      public NaruPlanItem setAttempts(int attempts)
    • incrementAttempts

      public NaruPlanItem incrementAttempts()
    • toElement

      public net.thevpc.nuts.elem.NElement toElement()