Record Class ProcessStatus

java.lang.Object
java.lang.Record
io.github.tobyjamesclements.parsley.api.ProcessStatus
Record Components:
process - the process name, as declared
state - whether the process is running, rebalancing or stopped
refusalReason - present when the process stopped to preserve the guarantee, absent when it is running or stopped for another cause
failureDetail - the diagnosis accompanying a stop, when one is available
tasks - the delivery state of each task this instance currently runs, in partition order: what is held, what it waits for, and how much causal metadata it carries; empty before any task has initialised or after every task has closed

public record ProcessStatus(String process, ProcessStatus.State state, Optional<ParsleyFailClosedException.Reason> refusalReason, Optional<String> failureDetail, List<TaskStatus> tasks) extends Record
The state of one process at a moment in time.
See Also:
  • Constructor Details

  • Method Details

    • stoppedDeliberately

      public boolean stoppedDeliberately()
      Distinguishes a stop taken to preserve the guarantee from any other stop.
      Returns:
      true when a refusalReason() is present
    • 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.
    • process

      public String process()
      Returns the value of the process record component.
      Returns:
      the value of the process record component
    • state

      public ProcessStatus.State state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • refusalReason

      Returns the value of the refusalReason record component.
      Returns:
      the value of the refusalReason record component
    • failureDetail

      public Optional<String> failureDetail()
      Returns the value of the failureDetail record component.
      Returns:
      the value of the failureDetail record component
    • tasks

      public List<TaskStatus> tasks()
      Returns the value of the tasks record component.
      Returns:
      the value of the tasks record component