Package org.apache.http.impl.client
Class DefaultHttpRequestRetryHandler
java.lang.Object
org.apache.http.impl.client.DefaultHttpRequestRetryHandler
- All Implemented Interfaces:
HttpRequestRetryHandler
public class DefaultHttpRequestRetryHandler extends Object implements HttpRequestRetryHandler
The default
HttpRequestRetryHandler used by request executors.- Author:
- Michael Becke, Oleg Kalnichevski
-
Constructor Summary
Constructors Constructor Description DefaultHttpRequestRetryHandler()Default constructorDefaultHttpRequestRetryHandler(int retryCount, boolean requestSentRetryEnabled)Default constructor -
Method Summary
Modifier and Type Method Description intgetRetryCount()booleanisRequestSentRetryEnabled()booleanretryRequest(IOException exception, int executionCount, HttpContext context)UsedretryCountandrequestSentRetryEnabledto determine if the given method should be retried.
-
Constructor Details
-
DefaultHttpRequestRetryHandler
public DefaultHttpRequestRetryHandler(int retryCount, boolean requestSentRetryEnabled)Default constructor -
DefaultHttpRequestRetryHandler
public DefaultHttpRequestRetryHandler()Default constructor
-
-
Method Details
-
retryRequest
UsedretryCountandrequestSentRetryEnabledto determine if the given method should be retried.- Specified by:
retryRequestin interfaceHttpRequestRetryHandler- Parameters:
exception- the exception that occurredexecutionCount- the number of times this method has been unsuccessfully executedcontext- the context for the request execution- Returns:
trueif the method should be retried,falseotherwise
-
isRequestSentRetryEnabled
public boolean isRequestSentRetryEnabled()- Returns:
trueif this handler will retry methods that have successfully sent their request,falseotherwise
-
getRetryCount
public int getRetryCount()- Returns:
- the maximum number of times a method will be retried
-