X
- The type of exception you are checking and could possibly return.public abstract class RetryDeterminer<X extends java.lang.Exception>
extends java.lang.Object
ResilientOperation
.Modifier and Type | Field and Description |
---|---|
static RetryDeterminer<java.lang.Exception> |
DEFAULT
Retries when either SOCKET_ERRORS or SERVER_ERRORS would retry.
|
static RetryDeterminer<java.io.IOException> |
RATE_LIMIT_ERRORS
A rate limited determiner that uses a generic ApiErrorExtractor.
|
static RetryDeterminer<java.io.IOException> |
SERVER_ERRORS
Server errors RetryDeterminer decides to retry on HttpResponseExceptions that return a 500.
|
static RetryDeterminer<java.io.IOException> |
SOCKET_ERRORS
Socket errors retry determiner retries on socket exceptions.
|
Constructor and Description |
---|
RetryDeterminer() |
Modifier and Type | Method and Description |
---|---|
static RetryDeterminer<java.io.IOException> |
createRateLimitedRetryDeterminer(ApiErrorExtractor errorExtractor)
A
RetryDeterminer that retries on rate limited errors as determined by the
provided ApiErrorExtractor . |
abstract boolean |
shouldRetry(X e)
Determines if we should attempt a retry depending on the caught exception.
|
public static final RetryDeterminer<java.lang.Exception> DEFAULT
public static final RetryDeterminer<java.io.IOException> SOCKET_ERRORS
public static final RetryDeterminer<java.io.IOException> SERVER_ERRORS
public static final RetryDeterminer<java.io.IOException> RATE_LIMIT_ERRORS
public abstract boolean shouldRetry(X e)
To indicate that no retry should be made, return false. If no retry, the exception should be returned to the user.
e
- Exception of type X that can be examined to determine if a retry is possible.public static RetryDeterminer<java.io.IOException> createRateLimitedRetryDeterminer(ApiErrorExtractor errorExtractor)
RetryDeterminer
that retries on rate limited errors as determined by the
provided ApiErrorExtractor
.errorExtractor
- The ApiErrorExtractor
that will determine if it is rate limited.Copyright © 2019. All rights reserved.