Class DefaultHttpRequestRetryHandler

    • Constructor Summary

      Constructors 
      Constructor 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getRetryCount()  
      boolean isRequestSentRetryEnabled()  
      boolean retryRequest​(java.io.IOException exception, int executionCount, HttpContext context)
      Used retryCount and requestSentRetryEnabled to determine if the given method should be retried.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultHttpRequestRetryHandler

        public DefaultHttpRequestRetryHandler​(int retryCount,
                                              boolean requestSentRetryEnabled)
        Create the request retry handler using the following list of non-retriable IOException classes:
        • InterruptedIOException
        • UnknownHostException
        • ConnectException
        • SSLException
        Parameters:
        retryCount - how many times to retry; 0 means no retries
        requestSentRetryEnabled - true if it's OK to retry non-idempotent requests that have been sent
      • DefaultHttpRequestRetryHandler

        public 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
    • Method Detail

      • retryRequest

        public boolean retryRequest​(java.io.IOException exception,
                                    int executionCount,
                                    HttpContext context)
        Used retryCount and requestSentRetryEnabled to determine if the given method should be retried.
        Specified by:
        retryRequest in interface HttpRequestRetryHandler
        Parameters:
        exception - the exception that occurred
        executionCount - the number of times this method has been unsuccessfully executed
        context - the context for the request execution
        Returns:
        true if the method should be retried, false otherwise
      • 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