Class ShiftByMultipleOf

java.lang.Object
All Implemented Interfaces:
Delay

public class ShiftByMultipleOf
extends MultipleOf
Provides delay seconds which is a multiple of the delay shifted from previous attempt's accrual until AbstractDelay.timeout has been reached. After which it will return Duration.ZERO
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  ShiftByMultipleOf.Builder  
  • Method Summary

    Modifier and Type Method Description
    java.time.Duration nextDelay​(int attempt)
    Returns the new delay amount to stabilize as defined by Duration time.
    static ShiftByMultipleOf.Builder shiftedOf()  

    Methods inherited from class software.amazon.cloudformation.proxy.delay.MultipleOf

    multipleOf

    Methods inherited from class software.amazon.cloudformation.proxy.delay.Constant

    of

    Methods inherited from class java.lang.Object

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

    • shiftedOf

      public static ShiftByMultipleOf.Builder shiftedOf()
    • nextDelay

      public java.time.Duration nextDelay​(int attempt)
      Description copied from interface: Delay
      Returns the new delay amount to stabilize as defined by Duration time. This returns -1 to indicate that we are done with delays from this instance Different implementations can return different values
      Specified by:
      nextDelay in interface Delay
      Overrides:
      nextDelay in class MultipleOf
      Parameters:
      attempt - , starts with 1
      Returns:
      the next amount to wait for or Duration.ZERO to indicate delay is complete