org.apache.http.impl.client
Class DefaultHttpRequestRetryHandlerHC4

java.lang.Object
  extended by org.apache.http.impl.client.DefaultHttpRequestRetryHandlerHC4
All Implemented Interfaces:
org.apache.http.client.HttpRequestRetryHandler
Direct Known Subclasses:
StandardHttpRequestRetryHandler

@Immutable
public class DefaultHttpRequestRetryHandlerHC4
extends java.lang.Object
implements org.apache.http.client.HttpRequestRetryHandler

The default HttpRequestRetryHandler used by request executors.

Since:
4.0

Field Summary
static DefaultHttpRequestRetryHandlerHC4 INSTANCE
           
 
Constructor Summary
  DefaultHttpRequestRetryHandlerHC4()
          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
  DefaultHttpRequestRetryHandlerHC4(int retryCount, boolean requestSentRetryEnabled)
          Create the request retry handler using the following list of non-retriable IOException classes:
InterruptedIOException UnknownHostException ConnectException SSLException
protected DefaultHttpRequestRetryHandlerHC4(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
 
Method Summary
 int getRetryCount()
           
protected  boolean handleAsIdempotent(org.apache.http.HttpRequest request)
           
 boolean isRequestSentRetryEnabled()
           
protected  boolean requestIsAborted(org.apache.http.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DefaultHttpRequestRetryHandlerHC4 INSTANCE
Constructor Detail

DefaultHttpRequestRetryHandlerHC4

protected DefaultHttpRequestRetryHandlerHC4(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

Parameters:
retryCount - how many times to retry; 0 means no retries
requestSentRetryEnabled - true if it's OK to retry requests that have been sent
clazzes - the IOException types that should not be retried
Since:
4.3

DefaultHttpRequestRetryHandlerHC4

public DefaultHttpRequestRetryHandlerHC4(int retryCount,
                                         boolean requestSentRetryEnabled)
Create the request retry handler using the following list of non-retriable IOException classes:

Parameters:
retryCount - how many times to retry; 0 means no retries
requestSentRetryEnabled - true if it's OK to retry requests that have been sent

DefaultHttpRequestRetryHandlerHC4

public DefaultHttpRequestRetryHandlerHC4()
Create the request retry handler with a retry count of 3, requestSentRetryEnabled false and using the following list of non-retriable IOException classes:

Method Detail

retryRequest

public 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.

Specified by:
retryRequest in interface org.apache.http.client.HttpRequestRetryHandler

isRequestSentRetryEnabled

public boolean isRequestSentRetryEnabled()
Returns:
true if this handler will retry methods that have successfully sent their request, false otherwise

getRetryCount

public int getRetryCount()
Returns:
the maximum number of times a method will be retried

handleAsIdempotent

protected boolean handleAsIdempotent(org.apache.http.HttpRequest request)
Since:
4.2

requestIsAborted

@Deprecated
protected boolean requestIsAborted(org.apache.http.HttpRequest request)
Deprecated. (4.3)

Since:
4.2