Package org.apache.http.client
Interface ConnectionBackoffStrategy
- All Known Implementing Classes:
DefaultBackoffStrategy,NullBackoffStrategy
public interface ConnectionBackoffStrategy
When managing a dynamic number of connections for a given route, this
strategy assesses whether a given request execution outcome should
result in a backoff signal or not, based on either examining the
Throwable that resulted or by examining the resulting
response (e.g. for its status code).- Since:
- 4.2
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether seeing the givenThrowableas a result of request execution should result in a backoff signal.booleanshouldBackoff(HttpResponse resp) Determines whether receiving the givenHttpResponseas a result of request execution should result in a backoff signal.
-
Method Details
-
shouldBackoff
Determines whether seeing the givenThrowableas a result of request execution should result in a backoff signal.- Parameters:
t- theThrowablethat happened- Returns:
trueif a backoff signal should be given
-
shouldBackoff
Determines whether receiving the givenHttpResponseas a result of request execution should result in a backoff signal. Implementations MUST restrict themselves to examining the response header and MUST NOT consume any of the response body, if any.- Parameters:
resp- theHttpResponsethat was received- Returns:
trueif a backoff signal should be given
-