Record Class CentralOutcome

java.lang.Object
java.lang.Record
network.ike.plugin.release.central.CentralOutcome
Record Components:
succeeded - whether the Central deploy completed successfully (sync path) or was successfully spawned (async path)
attempts - number of attempts made (zero before the first try)
asyncSpawned - whether the deploy was spawned as a detached subprocess (#484)
sentinelPath - IPC sentinel file path when asyncSpawned is true, otherwise null
logPath - log file the async subprocess streams to when asyncSpawned is true, otherwise null
skipReason - human-readable reason if the phase was skipped, or null when not skipped
failureSummary - human-readable summary when the phase was attempted and exhausted retries, or null when not failed

public record CentralOutcome(boolean succeeded, int attempts, boolean asyncSpawned, Path sentinelPath, Path logPath, String skipReason, String failureSummary) extends Record
Outcome of the Maven Central deploy phase in the release pipeline.

Central deploys have two paths: a synchronous retry loop and a detached async-bash spawn (IKE-Network/ike-issues#484). Both share this outcome record. When the async path is taken, asyncSpawned is true and sentinelPath + logPath point to the IPC files that ike:central-status reads to discover post-process completion.

Instances are immutable. Callers update state by constructing a new instance via the with* helpers. initial() returns the "did not run" state — appropriate for a draft preview or a release aborted before the deploy phase.

Carved out of ReleaseDraftMojo during the Phase 4 decomposition (IKE-Network/ike-issues#489 P1) so that downstream commits can replace mojo fields with phase-returned outcomes without further reshaping.

  • Constructor Details

    • CentralOutcome

      public CentralOutcome(boolean succeeded, int attempts, boolean asyncSpawned, Path sentinelPath, Path logPath, String skipReason, String failureSummary)
      Creates an instance of a CentralOutcome record class.
      Parameters:
      succeeded - the value for the succeeded record component
      attempts - the value for the attempts record component
      asyncSpawned - the value for the asyncSpawned record component
      sentinelPath - the value for the sentinelPath record component
      logPath - the value for the logPath record component
      skipReason - the value for the skipReason record component
      failureSummary - the value for the failureSummary record component
  • Method Details

    • initial

      public static CentralOutcome initial()
      Returns the initial outcome — not succeeded, zero attempts, no async spawn, no skip, no failure.
      Returns:
      the initial CentralOutcome
    • withAttempts

      public CentralOutcome withAttempts(int attempts)
      Returns a copy of this outcome with the attempt count replaced.
      Parameters:
      attempts - the new attempt count
      Returns:
      a new CentralOutcome with the updated attempt count
    • withSucceeded

      public CentralOutcome withSucceeded(boolean succeeded)
      Returns a copy of this outcome with the success flag replaced.
      Parameters:
      succeeded - the new success flag
      Returns:
      a new CentralOutcome with the updated success flag
    • withAsyncSpawned

      public CentralOutcome withAsyncSpawned(boolean asyncSpawned)
      Returns a copy of this outcome with the asyncSpawned flag replaced.
      Parameters:
      asyncSpawned - the new async-spawn flag
      Returns:
      a new CentralOutcome with the updated async-spawn flag
    • withSentinelPath

      public CentralOutcome withSentinelPath(Path sentinelPath)
      Returns a copy of this outcome with the sentinel-file path replaced.
      Parameters:
      sentinelPath - the new sentinel path, or null to clear
      Returns:
      a new CentralOutcome with the updated sentinel path
    • withLogPath

      public CentralOutcome withLogPath(Path logPath)
      Returns a copy of this outcome with the log-file path replaced.
      Parameters:
      logPath - the new log path, or null to clear
      Returns:
      a new CentralOutcome with the updated log path
    • withSkipReason

      public CentralOutcome withSkipReason(String skipReason)
      Returns a copy of this outcome with the skip reason replaced.
      Parameters:
      skipReason - the new skip reason, or null to clear
      Returns:
      a new CentralOutcome with the updated skip reason
    • withFailureSummary

      public CentralOutcome withFailureSummary(String failureSummary)
      Returns a copy of this outcome with the failure summary replaced.
      Parameters:
      failureSummary - the new failure summary, or null to clear
      Returns:
      a new CentralOutcome with the updated failure summary
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • succeeded

      public boolean succeeded()
      Returns the value of the succeeded record component.
      Returns:
      the value of the succeeded record component
    • attempts

      public int attempts()
      Returns the value of the attempts record component.
      Returns:
      the value of the attempts record component
    • asyncSpawned

      public boolean asyncSpawned()
      Returns the value of the asyncSpawned record component.
      Returns:
      the value of the asyncSpawned record component
    • sentinelPath

      public Path sentinelPath()
      Returns the value of the sentinelPath record component.
      Returns:
      the value of the sentinelPath record component
    • logPath

      public Path logPath()
      Returns the value of the logPath record component.
      Returns:
      the value of the logPath record component
    • skipReason

      public String skipReason()
      Returns the value of the skipReason record component.
      Returns:
      the value of the skipReason record component
    • failureSummary

      public String failureSummary()
      Returns the value of the failureSummary record component.
      Returns:
      the value of the failureSummary record component