X
- The type of exception you are checking and could possibly return.public abstract class RetryDeterminer<X extends Exception> extends Object
ResilientOperation
.Modifier and Type | Field and Description |
---|---|
static RetryDeterminer<Exception> |
DEFAULT
Retries when either SOCKET_ERRORS or SERVER_ERRORS would retry.
|
static RetryDeterminer<IOException> |
RATE_LIMIT_ERRORS
A rate limited determiner that uses a generic ApiErrorExtractor.
|
static RetryDeterminer<IOException> |
SERVER_ERRORS
Server errors RetryDeterminer decides to retry on HttpResponseExceptions that return a 500.
|
static RetryDeterminer<IOException> |
SOCKET_ERRORS
Socket errors retry determiner retries on socket exceptions.
|
Constructor and Description |
---|
RetryDeterminer() |
Modifier and Type | Method and Description |
---|---|
static RetryDeterminer<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<Exception> DEFAULT
public static final RetryDeterminer<IOException> SOCKET_ERRORS
public static final RetryDeterminer<IOException> SERVER_ERRORS
public static final RetryDeterminer<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<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 © 2017. All rights reserved.