Interface BackOffPolicy
- All Known Implementing Classes:
ExponentialBackOffPolicy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDeprecated.Value indicating that no more retries should be made, seegetNextBackOffMillis(). -
Method Summary
Modifier and TypeMethodDescriptionlongDeprecated.Gets the number of milliseconds to wait before retrying an HTTP request.booleanisBackOffRequired(int statusCode) Deprecated.Determines if back off is required based on the specified status code.voidreset()Deprecated.Reset Back off counters (if any) in an implementation-specific fashion.
-
Field Details
-
STOP
static final long STOPDeprecated.Value indicating that no more retries should be made, seegetNextBackOffMillis().- See Also:
-
-
Method Details
-
isBackOffRequired
boolean isBackOffRequired(int statusCode) Deprecated.Determines if back off is required based on the specified status code.Implementations may want to back off on server or product-specific errors.
- Parameters:
statusCode- HTTP status code
-
reset
void reset()Deprecated.Reset Back off counters (if any) in an implementation-specific fashion. -
getNextBackOffMillis
Deprecated.Gets the number of milliseconds to wait before retrying an HTTP request. IfSTOPis 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. }- Returns:
- the number of milliseconds to wait when backing off requests, or
STOPif no more retries should be made - Throws:
IOException
-
HttpBackOffUnsuccessfulResponseHandlerinstead.