Class RetrySchedule
java.lang.Object
network.ike.plugin.release.RetrySchedule
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 TypeMethodDescriptionstatic int[]parseSeconds(String property, String csv) Parses a comma-separated list of non-negative integer seconds into a backoff schedule array.static voidsleepBefore(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.
-
Method Details
-
parseSeconds
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- ifcsvis 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
secondsvalue of zero or less is a no-op (no sleep, no log). On thread interrupt, restores the interrupt flag and throws aMojoException.- Parameters:
log- logger for the wait-announcement lineseconds- seconds to wait (0 = no sleep)label- phase label ("Nexus deploy"/"Maven Central deploy")nextAttempt- the upcoming cycle numbermaxAttempts- configured max cycles
-