Record Class Checkpoint

java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.plan.Checkpoint
Record Components:
planId - the plan id (PlanJson.planId) the checkpoint belongs to
deploymentName - the plan's deployment name
steps - the completed steps, by key, in completion order
updatedAt - when the checkpoint was last written

public record Checkpoint(String planId, String deploymentName, Map<String, CompletedStep> steps, Instant updatedAt) extends Record
The progress of one plan's execution: every step known to exist, by logical key. Written by reconcile and execute after every step (immediately after a create is accepted, before waiting for it to provision), so a crashed or aborted run resumes without creating duplicates.

Immutable; with(CompletedStep, Instant) and without(String, Instant) return new instances.

  • Constructor Details

  • Method Details

    • empty

      public static Checkpoint empty(String planId, String deploymentName)
      An empty checkpoint for a plan.
      Parameters:
      planId - the plan id
      deploymentName - the deployment name
      Returns:
      a checkpoint with no step
    • step

      public Optional<CompletedStep> step(String key)
      The recorded step for a key.
      Parameters:
      key - the logical key
      Returns:
      the step, or empty
    • with

      public Checkpoint with(CompletedStep step, Instant now)
      This checkpoint with one step added or replaced.
      Parameters:
      step - the step
      now - the write time
      Returns:
      a new checkpoint
    • without

      public Checkpoint without(String key, Instant now)
      This checkpoint with one step removed (after a confirmed rollback delete).
      Parameters:
      key - the logical key
      now - the write time
      Returns:
      a new checkpoint
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • planId

      public String planId()
      Returns the value of the planId record component.
      Returns:
      the value of the planId record component
    • deploymentName

      public String deploymentName()
      Returns the value of the deploymentName record component.
      Returns:
      the value of the deploymentName record component
    • steps

      public Map<String, CompletedStep> steps()
      Returns the value of the steps record component.
      Returns:
      the value of the steps record component
    • updatedAt

      public Instant updatedAt()
      Returns the value of the updatedAt record component.
      Returns:
      the value of the updatedAt record component