Class RetrySchedule

java.lang.Object
network.ike.plugin.release.RetrySchedule

public final class RetrySchedule extends Object
Backoff-schedule parsing and pre-retry sleep helpers shared by the Nexus and Central deploy retry loops.

Extracted from ReleaseDraftMojo during the Phase 4 Commit 2 (IKE-Network/ike-issues#489) so that NexusPhase and CentralPhase can share a single canonical implementation instead of either duplicating the logic or depending back on the mojo.

Both methods are pure utilities with no instance state.

  • Method Summary

    Modifier and Type
    Method
    Description
    static int[]
    parseSeconds(String property, String csv)
    Parses a comma-separated list of non-negative integer seconds into a backoff schedule array.
    static void
    sleepBefore(org.apache.maven.api.plugin.Log log, int seconds, String label, int nextAttempt, int maxAttempts)
    Sleeps before the next retry cycle, with a clear log line so the operator knows the build isn't hung.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parseSeconds

      public static int[] parseSeconds(String property, String csv)
      Parses a comma-separated list of non-negative integer seconds into a backoff schedule array.

      Accepts whitespace between entries. Each entry must parse as a non-negative integer; zero is permitted (no sleep). The resulting array has one entry per configured cycle gap, so a schedule of "60,300,900" produces backoff {60, 300, 900} — applied as the wait before retry cycles 2, 3, and 4 respectively.

      Parameters:
      property - property name surfaced in error messages (e.g. "ike.deploy.nexus.backoffSeconds")
      csv - the raw comma-separated value
      Returns:
      parsed seconds array (length >= 1)
      Throws:
      org.apache.maven.api.plugin.MojoException - if csv is null or blank, an entry is non-integer, or an entry is negative
    • sleepBefore

      public static void sleepBefore(org.apache.maven.api.plugin.Log log, int seconds, String label, int nextAttempt, int maxAttempts)
      Sleeps before the next retry cycle, with a clear log line so the operator knows the build isn't hung.

      A seconds value of zero or less is a no-op (no sleep, no log). On thread interrupt, restores the interrupt flag and throws a MojoException.

      Parameters:
      log - logger for the wait-announcement line
      seconds - seconds to wait (0 = no sleep)
      label - phase label ("Nexus deploy" / "Maven Central deploy")
      nextAttempt - the upcoming cycle number
      maxAttempts - configured max cycles