public class RetryPolicy extends Object implements HttpPipelinePolicy
| Constructor and Description |
|---|
RetryPolicy()
Creates
RetryPolicy with default ExponentialBackoff as RetryStrategy and ignore the
delay provided in response header. |
RetryPolicy(RetryStrategy retryStrategy)
Creates a
RetryPolicy with the provided RetryStrategy and ignore the delay provided in
response header. |
RetryPolicy(RetryStrategy retryStrategy,
String retryAfterHeader,
ChronoUnit retryAfterTimeUnit)
Creates
RetryPolicy with the provided RetryStrategy and default ExponentialBackoff
as RetryStrategy. |
RetryPolicy(String retryAfterHeader,
ChronoUnit retryAfterTimeUnit)
Creates
RetryPolicy with default ExponentialBackoff as RetryStrategy and use
provided retryAfterHeader in HttpResponse headers for calculating retry delay. |
| Modifier and Type | Method and Description |
|---|---|
Mono<HttpResponse> |
process(HttpPipelineCallContext context,
HttpPipelineNextPolicy next)
Process provided request context and invokes the next policy.
|
public RetryPolicy()
RetryPolicy with default ExponentialBackoff as RetryStrategy and ignore the
delay provided in response header.public RetryPolicy(String retryAfterHeader, ChronoUnit retryAfterTimeUnit)
RetryPolicy with default ExponentialBackoff as RetryStrategy and use
provided retryAfterHeader in HttpResponse headers for calculating retry delay.retryAfterHeader - The HTTP header, such as 'Retry-After' or 'x-ms-retry-after-ms', to lookup for the
retry delay. If the value is null, RetryPolicy will use the retry strategy to compute the delay
and ignore the delay provided in response header.retryAfterTimeUnit - The time unit to use when applying the retry delay. null is valid if, and only
if, retryAfterHeader is null.NullPointerException - When retryAfterTimeUnit is null and retryAfterHeader is
not null.public RetryPolicy(RetryStrategy retryStrategy, String retryAfterHeader, ChronoUnit retryAfterTimeUnit)
RetryPolicy with the provided RetryStrategy and default ExponentialBackoff
as RetryStrategy. It will use provided retryAfterHeader in HttpResponse headers for
calculating retry delay.retryStrategy - The RetryStrategy used for retries.retryAfterHeader - The HTTP header, such as 'Retry-After' or 'x-ms-retry-after-ms', to lookup for the
retry delay. If the value is null, RetryPolicy will use the retry strategy to compute the delay
and ignore the delay provided in response header.retryAfterTimeUnit - The time unit to use when applying the retry delay. null is valid if, and only
if, retryAfterHeader is null.NullPointerException - When retryStrategy is null. Also when retryAfterTimeUnit
is null and retryAfterHeader is not null.public RetryPolicy(RetryStrategy retryStrategy)
RetryPolicy with the provided RetryStrategy and ignore the delay provided in
response header.retryStrategy - The RetryStrategy used for retries.NullPointerException - When retryStrategy is null.public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)
HttpPipelinePolicyprocess in interface HttpPipelinePolicycontext - request contextnext - The next policy to invoke.Copyright © 2019 Microsoft Corporation. All rights reserved.