Record Class ProcessStatus
java.lang.Object
java.lang.Record
io.github.tobyjamesclements.parsley.api.ProcessStatus
- Record Components:
process- the process name, as declaredstate- whether the process is running, rebalancing or stoppedrefusalReason- present when the process stopped to preserve the guarantee, absent when it is running or stopped for another causefailureDetail- the diagnosis accompanying a stop, when one is availabletasks- 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:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionProcessStatus(String process, ProcessStatus.State state, Optional<ParsleyFailClosedException.Reason> refusalReason, Optional<String> failureDetail) A status with no task detail, as reported before any task has initialised.ProcessStatus(String process, ProcessStatus.State state, Optional<ParsleyFailClosedException.Reason> refusalReason, Optional<String> failureDetail, List<TaskStatus> tasks) Copies the tasks. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefailureDetailrecord component.final inthashCode()Returns a hash code value for this object.process()Returns the value of theprocessrecord component.Returns the value of therefusalReasonrecord component.state()Returns the value of thestaterecord component.booleanDistinguishes a stop taken to preserve the guarantee from any other stop.tasks()Returns the value of thetasksrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ProcessStatus
public ProcessStatus(String process, ProcessStatus.State state, Optional<ParsleyFailClosedException.Reason> refusalReason, Optional<String> failureDetail, List<TaskStatus> tasks) Copies the tasks.- Throws:
IllegalArgumentException- if any component is null; absence is expressed through the emptyOptionals and the empty task list
-
ProcessStatus
public ProcessStatus(String process, ProcessStatus.State state, Optional<ParsleyFailClosedException.Reason> refusalReason, Optional<String> failureDetail) A status with no task detail, as reported before any task has initialised.- Parameters:
process- the process name, as declaredstate- whether the process is running, rebalancing or stoppedrefusalReason- present when the process stopped to preserve the guaranteefailureDetail- the diagnosis accompanying a stop, when one is available
-
-
Method Details
-
stoppedDeliberately
public boolean stoppedDeliberately()Distinguishes a stop taken to preserve the guarantee from any other stop.- Returns:
truewhen arefusalReason()is present
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
process
-
state
-
refusalReason
Returns the value of therefusalReasonrecord component.- Returns:
- the value of the
refusalReasonrecord component
-
failureDetail
Returns the value of thefailureDetailrecord component.- Returns:
- the value of the
failureDetailrecord component
-
tasks
-