Interface RetryCondition
- All Known Implementing Classes:
AndRetryCondition
,MaxNumberOfRetriesCondition
,OrRetryCondition
,RetryOnClockSkewCondition
,RetryOnErrorCodeCondition
,RetryOnExceptionsCondition
,RetryOnStatusCodeCondition
,RetryOnThrottlingCondition
,TokenBucketRetryCondition
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RetryCondition
static RetryCondition
none()
A retry condition that will NEVER allow retries.default void
requestSucceeded
(RetryPolicyContext context) Called by the SDK to notify this condition that the provided request succeeded.default void
Called by the SDK to notify this condition that the provided request will not be retried, because some retry condition determined that it shouldn't be retried.boolean
shouldRetry
(RetryPolicyContext context) Determine whether a request should or should not be retried.
-
Method Details
-
shouldRetry
Determine whether a request should or should not be retried.- Parameters:
context
- Context about the state of the last request and information about the number of requests made.- Returns:
- True if the request should be retried, false if not.
-
requestWillNotBeRetried
Called by the SDK to notify this condition that the provided request will not be retried, because some retry condition determined that it shouldn't be retried. -
requestSucceeded
Called by the SDK to notify this condition that the provided request succeeded. This method is invoked even if the execution never failed before (RetryPolicyContext.retriesAttempted()
is zero). -
defaultRetryCondition
-
none
A retry condition that will NEVER allow retries.
-