|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface BackOffPolicy
Strategy interface to control back off between retry attempts.
| Field Summary | |
|---|---|
static long |
STOP
Value indicating that no more retries should be made, see getNextBackOffMillis(). |
| Method Summary | |
|---|---|
long |
getNextBackOffMillis()
Gets the number of milliseconds to wait before retrying an HTTP request. |
boolean |
isBackOffRequired(int statusCode)
Determines if back off is required based on the specified status code. |
void |
reset()
Reset Back off counters (if any) in an implementation-specific fashion. |
| Field Detail |
|---|
static final long STOP
getNextBackOffMillis().
| Method Detail |
|---|
boolean isBackOffRequired(int statusCode)
Implementations may want to back off on server or product-specific errors.
statusCode - HTTP status codevoid reset()
long getNextBackOffMillis()
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||