Class DefaultServiceUnavailableRetryStrategy

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int maxRetries
      Maximum number of allowed retries if the server responds with a HTTP code in our retry code list.
      private long retryInterval
      Retry interval between subsequent requests, in milliseconds.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getRetryInterval()  
      boolean retryRequest​(org.apache.http.HttpResponse response, int executionCount, org.apache.http.protocol.HttpContext context)
      Determines if a method should be retried given the response from the target server.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • maxRetries

        private final int maxRetries
        Maximum number of allowed retries if the server responds with a HTTP code in our retry code list. Default value is 1.
      • retryInterval

        private final long retryInterval
        Retry interval between subsequent requests, in milliseconds. Default value is 1 second.
    • Constructor Detail

      • DefaultServiceUnavailableRetryStrategy

        public DefaultServiceUnavailableRetryStrategy​(int maxRetries,
                                                      int retryInterval)
      • DefaultServiceUnavailableRetryStrategy

        public DefaultServiceUnavailableRetryStrategy()
    • Method Detail

      • retryRequest

        public boolean retryRequest​(org.apache.http.HttpResponse response,
                                    int executionCount,
                                    org.apache.http.protocol.HttpContext context)
        Description copied from interface: ServiceUnavailableRetryStrategy
        Determines if a method should be retried given the response from the target server.
        Specified by:
        retryRequest in interface ServiceUnavailableRetryStrategy
        Parameters:
        response - the response from the target server
        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