Package com.styra.opa.openapi.utils
Class BackoffStrategy.Builder
java.lang.Object
com.styra.opa.openapi.utils.BackoffStrategy.Builder
- Enclosing class:
- BackoffStrategy
-
Method Summary
Modifier and TypeMethodDescriptionbaseFactor
(double baseFactor) Sets the backoff base factor.build()
exponent
(double baseFactor) Deprecated.initialInterval
(long duration, TimeUnit unit) Sets the initial intervaljitterFactor
(double jitterFactor) Sets the jitter factor used to randomize the backoff interval.maxElapsedTime
(long duration, TimeUnit unit) Sets the maximum elapsed timemaxInterval
(long duration, TimeUnit unit) Sets the maximum intervalretryConnectError
(boolean retry) Specifies whether connection errors should be retried.retryReadTimeoutError
(boolean retry) Specifies whether Read Timeout errors should be retried.Do not retry on connection error.Do not retry on Read Timeout error.
-
Method Details
-
initialInterval
Sets the initial interval- Parameters:
duration
- The initial interval.unit
- The time unit associated with duration.- Returns:
- The builder instance.
-
maxInterval
Sets the maximum interval- Parameters:
duration
- The maximum interval.unit
- The time unit associated with duration.- Returns:
- The builder instance.
-
maxElapsedTime
Sets the maximum elapsed time- Parameters:
duration
- The maximum elapsed time.unit
- The time unit associated with duration.- Returns:
- The builder instance.
-
baseFactor
Sets the backoff base factor.- Parameters:
baseFactor
- The base factor to use.- Returns:
- The builder instance.
-
exponent
Deprecated.usebaseFactor(double)
instead.Sets the backoff base factor.- Parameters:
baseFactor
- The base factor to use.- Returns:
- The builder instance.
-
jitterFactor
Sets the jitter factor used to randomize the backoff interval.- Parameters:
jitterFactor
- The jitter factor to use (default is 0.5f).- Returns:
- The builder instance.
-
retryConnectError
Specifies whether connection errors should be retried.- Parameters:
retry
- Whether to retry on connection error.- Returns:
- The builder instance.
-
throwConnectError
Do not retry on connection error.- Returns:
- The builder instance.
-
retryReadTimeoutError
Specifies whether Read Timeout errors should be retried.- Parameters:
retry
- Whether to retry on Read Timeout error.- Returns:
- The builder instance.
-
throwReadTimeoutError
Do not retry on Read Timeout error.- Returns:
- The builder instance.
-
build
-
baseFactor(double)
instead.