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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal<Long> Ugly, but forced by HttpClient APIServiceUnavailableRetryStrategy: the calls forretryRequest(HttpResponse, int, HttpContext)andgetRetryInterval()are done by same thread and are actually done from spot that are very close to each other (almost subsequent calls).private final intprivate final longprivate final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateResolverServiceUnavailableRetryStrategy(int retryCount, long retryInterval, long retryIntervalMax, Set<Integer> serviceUnavailableHttpCodes) -
Method Summary
Modifier and TypeMethodDescriptionlongprivate LongretryInterval(org.apache.http.HttpResponse httpResponse, int executionCount, org.apache.http.protocol.HttpContext httpContext) Calculates retry interval in milliseconds.booleanretryRequest(org.apache.http.HttpResponse response, int executionCount, org.apache.http.protocol.HttpContext context)
-
Field Details
-
retryCount
private final int retryCount -
retryInterval
private final long retryInterval -
retryIntervalMax
private final long retryIntervalMax -
RETRY_INTERVAL_HOLDER
Ugly, but forced by HttpClient APIServiceUnavailableRetryStrategy: the calls forretryRequest(HttpResponse, int, HttpContext)andgetRetryInterval()are done by same thread and are actually done from spot that are very close to each other (almost subsequent calls).
-
-
Constructor Details
-
ResolverServiceUnavailableRetryStrategy
-
-
Method Details
-
retryRequest
public boolean retryRequest(org.apache.http.HttpResponse response, int executionCount, org.apache.http.protocol.HttpContext context) - Specified by:
retryRequestin interfaceorg.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. IfHttpHeaders.RETRY_AFTERheader present, it obeys it. Otherwise, it returns} long value multiplied withinvalid @link
{@link this#retryIntervalexecutionCount(starts from 1 and goes 2, 3,...).- Returns:
- Long representing the retry interval as millis, or
nullif the request should be failed.
-
getRetryInterval
public long getRetryInterval()- Specified by:
getRetryIntervalin interfaceorg.apache.http.client.ServiceUnavailableRetryStrategy
-