Class HttpRequestRetryHandler

  • All Implemented Interfaces:
    org.apache.http.client.HttpRequestRetryHandler

    public class HttpRequestRetryHandler
    extends org.apache.http.impl.client.DefaultHttpRequestRetryHandler
    Only retries if no HttpEntity is present, or if the HttpEntity is repeatable. This avoids a NonRepeatableRequestException and returns the original exception.
    Author:
    Niels Meijer
    • Field Summary

      • Fields inherited from class org.apache.http.impl.client.DefaultHttpRequestRetryHandler

        INSTANCE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isRepeatable​(org.apache.http.HttpRequest request)
      Only attempt to retry the request if the request supports it! See org.apache.http.impl.execchain.RequestEntityProxy#isRepeatable(HttpRequest)
      boolean retryRequest​(IOException exception, int executionCount, org.apache.http.protocol.HttpContext context)  
      • Methods inherited from class org.apache.http.impl.client.DefaultHttpRequestRetryHandler

        getRetryCount, handleAsIdempotent, isRequestSentRetryEnabled, requestIsAborted
    • Constructor Detail

      • HttpRequestRetryHandler

        public HttpRequestRetryHandler​(int retryCount)
    • Method Detail

      • retryRequest

        public boolean retryRequest​(IOException exception,
                                    int executionCount,
                                    org.apache.http.protocol.HttpContext context)
        Specified by:
        retryRequest in interface org.apache.http.client.HttpRequestRetryHandler
        Overrides:
        retryRequest in class org.apache.http.impl.client.DefaultHttpRequestRetryHandler
      • isRepeatable

        public boolean isRepeatable​(org.apache.http.HttpRequest request)
        Only attempt to retry the request if the request supports it! See org.apache.http.impl.execchain.RequestEntityProxy#isRepeatable(HttpRequest)