Enum Class RetryStrategy

java.lang.Object
java.lang.Enum<RetryStrategy>
com.northconcepts.datapipeline.retry.RetryStrategy
All Implemented Interfaces:
IRetryStrategy, Serializable, Comparable<RetryStrategy>, Constable

public enum RetryStrategy extends Enum<RetryStrategy> implements IRetryStrategy
Standard IRetryStrategy backoff policies; every policy waits the initial delay before the first retry.
  • Enum Constant Details

    • NO_BACKOFF

      public static final RetryStrategy NO_BACKOFF
    • CONSTANT_BACKOFF

      public static final RetryStrategy CONSTANT_BACKOFF
    • LINEAR_BACKOFF

      public static final RetryStrategy LINEAR_BACKOFF
    • EXPONENTIAL_BACKOFF

      public static final RetryStrategy EXPONENTIAL_BACKOFF
    • EXPONENTIAL_RANDOM_BACKOFF

      public static final RetryStrategy EXPONENTIAL_RANDOM_BACKOFF
  • Method Details

    • values

      public static RetryStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RetryStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getRetryDelay

      public long getRetryDelay(int retryCount, long initialDelay)
      Description copied from interface: IRetryStrategy
      Returns the amount of time to wait (in milliseconds) before retrying the operation.
      Specified by:
      getRetryDelay in interface IRetryStrategy
      Parameters:
      retryCount - The number of retry attempts that have already been made starting with zero (0).
      initialDelay - The amount of time (in milliseconds) to wait before the first retry attempt.
      Returns:
      The amount of time to wait or initialDelay if this is the first retry attempt.
    • getRetryDelayImpl

      protected abstract long getRetryDelayImpl(int retryCount, long initialDelay)
      Returns the delay in milliseconds for the retries after the first (retryCount is at least 1).