HttpBackOffUnsuccessfulResponseHandler instead.
@Deprecated @Beta public interface BackOffPolicy
Beta
| Modifier and Type | Field and Description |
|---|---|
static long |
STOP
Deprecated.
Value indicating that no more retries should be made, see
getNextBackOffMillis().
|
| Modifier and Type | Method and Description |
|---|---|
long |
getNextBackOffMillis()
Deprecated.
Gets the number of milliseconds to wait before retrying an HTTP request.
|
boolean |
isBackOffRequired(int statusCode)
Deprecated.
Determines if back off is required based on the specified status code.
|
void |
reset()
Deprecated.
Reset Back off counters (if any) in an implementation-specific fashion.
|
static final long STOP
getNextBackOffMillis().
boolean isBackOffRequired(int statusCode)
Implementations may want to back off on server or product-specific errors.
statusCode - HTTP status code
void reset()
long getNextBackOffMillis()
throws IOException
STOP is returned, no retries should be made. This method should be used as follows:
long backoffTime = backoffPolicy.getNextBackoffMs();
if (backoffTime == BackoffPolicy.STOP) {
// Stop retrying.
} else {
// Retry after backoffTime.
}
STOP if no more retries should be made
IOException