Class HttpTransporter.ResolverServiceUnavailableRetryStrategy

java.lang.Object
org.eclipse.aether.transport.http.HttpTransporter.ResolverServiceUnavailableRetryStrategy
All Implemented Interfaces:
org.apache.http.client.ServiceUnavailableRetryStrategy
Enclosing class:
HttpTransporter

private static class HttpTransporter.ResolverServiceUnavailableRetryStrategy extends Object implements org.apache.http.client.ServiceUnavailableRetryStrategy
  • Field Details

    • retryCount

      private final int retryCount
    • retryInterval

      private final long retryInterval
    • retryIntervalMax

      private final long retryIntervalMax
    • serviceUnavailableHttpCodes

      private final Set<Integer> serviceUnavailableHttpCodes
    • RETRY_INTERVAL_HOLDER

      private static final ThreadLocal<Long> RETRY_INTERVAL_HOLDER
      Ugly, but forced by HttpClient API ServiceUnavailableRetryStrategy: the calls for retryRequest(HttpResponse, int, HttpContext) and getRetryInterval() are done by same thread and are actually done from spot that are very close to each other (almost subsequent calls).
  • Constructor Details

    • ResolverServiceUnavailableRetryStrategy

      private ResolverServiceUnavailableRetryStrategy(int retryCount, long retryInterval, long retryIntervalMax, Set<Integer> serviceUnavailableHttpCodes)
  • Method Details

    • retryRequest

      public boolean retryRequest(org.apache.http.HttpResponse response, int executionCount, org.apache.http.protocol.HttpContext context)
      Specified by:
      retryRequest in interface org.apache.http.client.ServiceUnavailableRetryStrategy
    • retryInterval

      private Long retryInterval(org.apache.http.HttpResponse httpResponse, int executionCount, org.apache.http.protocol.HttpContext httpContext)
      Calculates retry interval in milliseconds. If HttpHeaders.RETRY_AFTER header present, it obeys it. Otherwise, it returns
      invalid @link
      {@link this#retryInterval
      } long value multiplied with executionCount (starts from 1 and goes 2, 3,...).
      Returns:
      Long representing the retry interval as millis, or null if the request should be failed.
    • getRetryInterval

      public long getRetryInterval()
      Specified by:
      getRetryInterval in interface org.apache.http.client.ServiceUnavailableRetryStrategy