@Contract(threading=IMMUTABLE)
public class DefaultHttpRequestRetryHandler
extends java.lang.Object
implements org.apache.http.client.HttpRequestRetryHandler
HttpRequestRetryHandler used by request executors.| Modifier and Type | Field and Description |
|---|---|
static DefaultHttpRequestRetryHandler |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
|
DefaultHttpRequestRetryHandler()
Create the request retry handler with a retry count of 3, requestSentRetryEnabled false
and using the following list of non-retriable IOException classes:
InterruptedIOException UnknownHostException ConnectException SSLException |
|
DefaultHttpRequestRetryHandler(int retryCount,
boolean requestSentRetryEnabled)
Create the request retry handler using the following list of
non-retriable IOException classes:
InterruptedIOException UnknownHostException ConnectException SSLException |
protected |
DefaultHttpRequestRetryHandler(int retryCount,
boolean requestSentRetryEnabled,
java.util.Collection<java.lang.Class<? extends java.io.IOException>> clazzes)
Create the request retry handler using the specified IOException classes
|
| Modifier and Type | Method and Description |
|---|---|
int |
getRetryCount() |
protected boolean |
handleAsIdempotent(HttpRequest request) |
boolean |
isRequestSentRetryEnabled() |
protected boolean |
requestIsAborted(HttpRequest request)
Deprecated.
(4.3)
|
boolean |
retryRequest(java.io.IOException exception,
int executionCount,
org.apache.http.protocol.HttpContext context)
Used
retryCount and requestSentRetryEnabled to determine
if the given method should be retried. |
public static final DefaultHttpRequestRetryHandler INSTANCE
protected DefaultHttpRequestRetryHandler(int retryCount,
boolean requestSentRetryEnabled,
java.util.Collection<java.lang.Class<? extends java.io.IOException>> clazzes)
retryCount - how many times to retry; 0 means no retriesrequestSentRetryEnabled - true if it's OK to retry requests that have been sentclazzes - the IOException types that should not be retriedpublic DefaultHttpRequestRetryHandler(int retryCount,
boolean requestSentRetryEnabled)
retryCount - how many times to retry; 0 means no retriesrequestSentRetryEnabled - true if it's OK to retry non-idempotent requests that have been sentpublic DefaultHttpRequestRetryHandler()
public boolean retryRequest(java.io.IOException exception,
int executionCount,
org.apache.http.protocol.HttpContext context)
retryCount and requestSentRetryEnabled to determine
if the given method should be retried.retryRequest in interface org.apache.http.client.HttpRequestRetryHandlerpublic boolean isRequestSentRetryEnabled()
true if this handler will retry methods that have
successfully sent their request, false otherwisepublic int getRetryCount()
protected boolean handleAsIdempotent(HttpRequest request)
@Deprecated protected boolean requestIsAborted(HttpRequest request)