Top Description Methods
org.apache.http.client

public Interface ConnectionBackoffStrategy

Known Direct Implementers
org.apache.http.impl.client.DefaultBackoffStrategy, org.apache.http.impl.client.NullBackoffStrategy
Imports
org.apache.http.HttpResponse

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 TypeMethod and Description
public boolean

Returns:

true if a backoff signal should be given
shouldBackoff
(Throwable
the Throwable that happened
t
)

Determines whether seeing the given Throwable as a result of request execution should result in a backoff signal.

public boolean

Returns:

true if a backoff signal should be given
shouldBackoff
(HttpResponse
the HttpResponse that was received
resp
)

Determines whether receiving the given HttpResponse as a result of request execution should result in a backoff signal.

Method Detail

shouldBackoffback to summary
public boolean shouldBackoff(Throwable t)

Determines whether seeing the given Throwable as a result of request execution should result in a backoff signal.

Parameters
t:Throwable

the Throwable that happened

Returns:boolean

true if a backoff signal should be given

shouldBackoffback to summary
public boolean shouldBackoff(HttpResponse resp)

Determines whether receiving the given HttpResponse as 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:HttpResponse

the HttpResponse that was received

Returns:boolean

true if a backoff signal should be given