Share via


HttpRetryPolicy Class

  • java.lang.Object
    • com.azure.resourcemanager.appcontainers.models.HttpRetryPolicy

Implements

public final class HttpRetryPolicy
implements JsonSerializable<HttpRetryPolicy>

Policy that defines http request retry conditions.

Constructor Summary

Constructor Description
HttpRetryPolicy()

Creates an instance of HttpRetryPolicy class.

Method Summary

Modifier and Type Method and Description
List<String> errors()

Get the errors property: Errors that can trigger a retry.

static HttpRetryPolicy fromJson(JsonReader jsonReader)

Reads an instance of HttpRetryPolicy from the JsonReader.

List<HeaderMatch> headers()

Get the headers property: Headers that must be present for a request to be retried.

List<Integer> httpStatusCodes()

Get the httpStatusCodes property: Additional http status codes that can trigger a retry.

Long initialDelayInMilliseconds()

Get the initialDelayInMilliseconds property: Initial delay, in milliseconds, before retrying a request.

Long maxIntervalInMilliseconds()

Get the maxIntervalInMilliseconds property: Maximum interval, in milliseconds, between retries.

Integer maxRetries()

Get the maxRetries property: Maximum number of times a request will retry.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

HttpRetryPolicy withErrors(List<String> errors)

Set the errors property: Errors that can trigger a retry.

HttpRetryPolicy withHeaders(List<HeaderMatch> headers)

Set the headers property: Headers that must be present for a request to be retried.

HttpRetryPolicy withHttpStatusCodes(List<Integer> httpStatusCodes)

Set the httpStatusCodes property: Additional http status codes that can trigger a retry.

HttpRetryPolicy withInitialDelayInMilliseconds(Long initialDelayInMilliseconds)

Set the initialDelayInMilliseconds property: Initial delay, in milliseconds, before retrying a request.

HttpRetryPolicy withMaxIntervalInMilliseconds(Long maxIntervalInMilliseconds)

Set the maxIntervalInMilliseconds property: Maximum interval, in milliseconds, between retries.

HttpRetryPolicy withMaxRetries(Integer maxRetries)

Set the maxRetries property: Maximum number of times a request will retry.

Methods inherited from java.lang.Object

Constructor Details

HttpRetryPolicy

public HttpRetryPolicy()

Creates an instance of HttpRetryPolicy class.

Method Details

errors

public List<String> errors()

Get the errors property: Errors that can trigger a retry.

Returns:

the errors value.

fromJson

public static HttpRetryPolicy fromJson(JsonReader jsonReader)

Reads an instance of HttpRetryPolicy from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of HttpRetryPolicy if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the HttpRetryPolicy.

headers

public List<HeaderMatch> headers()

Get the headers property: Headers that must be present for a request to be retried.

Returns:

the headers value.

httpStatusCodes

public List<Integer> httpStatusCodes()

Get the httpStatusCodes property: Additional http status codes that can trigger a retry.

Returns:

the httpStatusCodes value.

initialDelayInMilliseconds

public Long initialDelayInMilliseconds()

Get the initialDelayInMilliseconds property: Initial delay, in milliseconds, before retrying a request.

Returns:

the initialDelayInMilliseconds value.

maxIntervalInMilliseconds

public Long maxIntervalInMilliseconds()

Get the maxIntervalInMilliseconds property: Maximum interval, in milliseconds, between retries.

Returns:

the maxIntervalInMilliseconds value.

maxRetries

public Integer maxRetries()

Get the maxRetries property: Maximum number of times a request will retry.

Returns:

the maxRetries value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withErrors

public HttpRetryPolicy withErrors(List<String> errors)

Set the errors property: Errors that can trigger a retry.

Parameters:

errors - the errors value to set.

Returns:

the HttpRetryPolicy object itself.

withHeaders

public HttpRetryPolicy withHeaders(List<HeaderMatch> headers)

Set the headers property: Headers that must be present for a request to be retried.

Parameters:

headers - the headers value to set.

Returns:

the HttpRetryPolicy object itself.

withHttpStatusCodes

public HttpRetryPolicy withHttpStatusCodes(List<Integer> httpStatusCodes)

Set the httpStatusCodes property: Additional http status codes that can trigger a retry.

Parameters:

httpStatusCodes - the httpStatusCodes value to set.

Returns:

the HttpRetryPolicy object itself.

withInitialDelayInMilliseconds

public HttpRetryPolicy withInitialDelayInMilliseconds(Long initialDelayInMilliseconds)

Set the initialDelayInMilliseconds property: Initial delay, in milliseconds, before retrying a request.

Parameters:

initialDelayInMilliseconds - the initialDelayInMilliseconds value to set.

Returns:

the HttpRetryPolicy object itself.

withMaxIntervalInMilliseconds

public HttpRetryPolicy withMaxIntervalInMilliseconds(Long maxIntervalInMilliseconds)

Set the maxIntervalInMilliseconds property: Maximum interval, in milliseconds, between retries.

Parameters:

maxIntervalInMilliseconds - the maxIntervalInMilliseconds value to set.

Returns:

the HttpRetryPolicy object itself.

withMaxRetries

public HttpRetryPolicy withMaxRetries(Integer maxRetries)

Set the maxRetries property: Maximum number of times a request will retry.

Parameters:

maxRetries - the maxRetries value to set.

Returns:

the HttpRetryPolicy object itself.

Applies to