97 строки
10 KiB
YAML
97 строки
10 KiB
YAML
### YamlMime:JavaType
|
|
uid: "com.azure.core.http.policy.RetryOptions"
|
|
fullName: "com.azure.core.http.policy.RetryOptions"
|
|
name: "RetryOptions"
|
|
nameWithType: "RetryOptions"
|
|
summary: "The `RetryOptions` class provides configuration options for retry strategies."
|
|
inheritances:
|
|
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
|
|
inheritedClassMethods:
|
|
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
|
|
methodsRef:
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
|
|
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
|
|
syntax: "public class **RetryOptions**"
|
|
constructors:
|
|
- uid: "com.azure.core.http.policy.RetryOptions.RetryOptions(com.azure.core.http.policy.ExponentialBackoffOptions)"
|
|
fullName: "com.azure.core.http.policy.RetryOptions.RetryOptions(ExponentialBackoffOptions exponentialBackoffOptions)"
|
|
name: "RetryOptions(ExponentialBackoffOptions exponentialBackoffOptions)"
|
|
nameWithType: "RetryOptions.RetryOptions(ExponentialBackoffOptions exponentialBackoffOptions)"
|
|
summary: "Creates a new instance that uses <xref uid=\"com.azure.core.http.policy.ExponentialBackoffOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ExponentialBackoffOptions\"></xref>."
|
|
parameters:
|
|
- description: "The <xref uid=\"com.azure.core.http.policy.ExponentialBackoffOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ExponentialBackoffOptions\"></xref>."
|
|
name: "exponentialBackoffOptions"
|
|
type: "<xref href=\"com.azure.core.http.policy.ExponentialBackoffOptions?alt=com.azure.core.http.policy.ExponentialBackoffOptions&text=ExponentialBackoffOptions\" data-throw-if-not-resolved=\"False\" />"
|
|
syntax: "public RetryOptions(ExponentialBackoffOptions exponentialBackoffOptions)"
|
|
desc: "Creates a new instance that uses <xref uid=\"com.azure.core.http.policy.ExponentialBackoffOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ExponentialBackoffOptions\"></xref>."
|
|
- uid: "com.azure.core.http.policy.RetryOptions.RetryOptions(com.azure.core.http.policy.FixedDelayOptions)"
|
|
fullName: "com.azure.core.http.policy.RetryOptions.RetryOptions(FixedDelayOptions fixedDelayOptions)"
|
|
name: "RetryOptions(FixedDelayOptions fixedDelayOptions)"
|
|
nameWithType: "RetryOptions.RetryOptions(FixedDelayOptions fixedDelayOptions)"
|
|
summary: "Creates a new instance that uses <xref uid=\"com.azure.core.http.policy.FixedDelayOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FixedDelayOptions\"></xref>."
|
|
parameters:
|
|
- description: "The <xref uid=\"com.azure.core.http.policy.FixedDelayOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FixedDelayOptions\"></xref>."
|
|
name: "fixedDelayOptions"
|
|
type: "<xref href=\"com.azure.core.http.policy.FixedDelayOptions?alt=com.azure.core.http.policy.FixedDelayOptions&text=FixedDelayOptions\" data-throw-if-not-resolved=\"False\" />"
|
|
syntax: "public RetryOptions(FixedDelayOptions fixedDelayOptions)"
|
|
desc: "Creates a new instance that uses <xref uid=\"com.azure.core.http.policy.FixedDelayOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FixedDelayOptions\"></xref>."
|
|
methods:
|
|
- uid: "com.azure.core.http.policy.RetryOptions.getExponentialBackoffOptions()"
|
|
fullName: "com.azure.core.http.policy.RetryOptions.getExponentialBackoffOptions()"
|
|
name: "getExponentialBackoffOptions()"
|
|
nameWithType: "RetryOptions.getExponentialBackoffOptions()"
|
|
summary: "Gets the configuration for exponential backoff if configured."
|
|
syntax: "public ExponentialBackoffOptions getExponentialBackoffOptions()"
|
|
desc: "Gets the configuration for exponential backoff if configured."
|
|
returns:
|
|
description: "The <xref uid=\"com.azure.core.http.policy.ExponentialBackoffOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ExponentialBackoffOptions\"></xref>."
|
|
type: "<xref href=\"com.azure.core.http.policy.ExponentialBackoffOptions?alt=com.azure.core.http.policy.ExponentialBackoffOptions&text=ExponentialBackoffOptions\" data-throw-if-not-resolved=\"False\" />"
|
|
- uid: "com.azure.core.http.policy.RetryOptions.getFixedDelayOptions()"
|
|
fullName: "com.azure.core.http.policy.RetryOptions.getFixedDelayOptions()"
|
|
name: "getFixedDelayOptions()"
|
|
nameWithType: "RetryOptions.getFixedDelayOptions()"
|
|
summary: "Gets the configuration for exponential backoff if configured."
|
|
syntax: "public FixedDelayOptions getFixedDelayOptions()"
|
|
desc: "Gets the configuration for exponential backoff if configured."
|
|
returns:
|
|
description: "The <xref uid=\"com.azure.core.http.policy.FixedDelayOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FixedDelayOptions\"></xref>."
|
|
type: "<xref href=\"com.azure.core.http.policy.FixedDelayOptions?alt=com.azure.core.http.policy.FixedDelayOptions&text=FixedDelayOptions\" data-throw-if-not-resolved=\"False\" />"
|
|
- uid: "com.azure.core.http.policy.RetryOptions.getShouldRetryCondition()"
|
|
fullName: "com.azure.core.http.policy.RetryOptions.getShouldRetryCondition()"
|
|
name: "getShouldRetryCondition()"
|
|
nameWithType: "RetryOptions.getShouldRetryCondition()"
|
|
summary: "Gets the predicate that determines if a retry should be attempted."
|
|
syntax: "public Predicate<RequestRetryCondition> getShouldRetryCondition()"
|
|
desc: "Gets the predicate that determines if a retry should be attempted.\n\nIf null, the default behavior is to retry HTTP responses with status codes 408, 429, and any 500 status code that isn't 501 or 505. And to retry any <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Exception\"></xref>."
|
|
returns:
|
|
description: "The predicate that determines if a retry should be attempted."
|
|
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html\">Predicate</a><<xref href=\"com.azure.core.http.policy.RequestRetryCondition?alt=com.azure.core.http.policy.RequestRetryCondition&text=RequestRetryCondition\" data-throw-if-not-resolved=\"False\" />>"
|
|
- uid: "com.azure.core.http.policy.RetryOptions.setShouldRetryCondition(java.util.function.Predicate<com.azure.core.http.policy.RequestRetryCondition>)"
|
|
fullName: "com.azure.core.http.policy.RetryOptions.setShouldRetryCondition(Predicate<RequestRetryCondition> shouldRetryCondition)"
|
|
name: "setShouldRetryCondition(Predicate<RequestRetryCondition> shouldRetryCondition)"
|
|
nameWithType: "RetryOptions.setShouldRetryCondition(Predicate<RequestRetryCondition> shouldRetryCondition)"
|
|
summary: "Sets the predicate that determines if a retry should be attempted."
|
|
parameters:
|
|
- description: "The predicate that determines if a retry should be attempted for the given\n <xref uid=\"com.azure.core.http.HttpResponse\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpResponse\"></xref>."
|
|
name: "shouldRetryCondition"
|
|
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html\">Predicate</a><<xref href=\"com.azure.core.http.policy.RequestRetryCondition?alt=com.azure.core.http.policy.RequestRetryCondition&text=RequestRetryCondition\" data-throw-if-not-resolved=\"False\" />>"
|
|
syntax: "public RetryOptions setShouldRetryCondition(Predicate<RequestRetryCondition> shouldRetryCondition)"
|
|
desc: "Sets the predicate that determines if a retry should be attempted.\n\nIf null, the default behavior is to retry HTTP responses with status codes 408, 429, and any 500 status code that isn't 501 or 505. And to retry any <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Exception\"></xref>."
|
|
returns:
|
|
description: "The updated <xref uid=\"com.azure.core.http.policy.RetryOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RetryOptions\"></xref> object."
|
|
type: "<xref href=\"com.azure.core.http.policy.RetryOptions?alt=com.azure.core.http.policy.RetryOptions&text=RetryOptions\" data-throw-if-not-resolved=\"False\" />"
|
|
type: "class"
|
|
desc: "The `RetryOptions` class provides configuration options for retry strategies. It supports both <xref uid=\"com.azure.core.http.policy.ExponentialBackoffOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ExponentialBackoffOptions\"></xref> and <xref uid=\"com.azure.core.http.policy.FixedDelayOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FixedDelayOptions\"></xref>.\n\nThis class is useful when you need to customize the behavior of retries in the HTTP pipeline. It allows you to specify the type of retry strategy and its options.\n\nHere's a code sample of how to use this class:\n\nIn these examples, `RetryOptions` is created with either `ExponentialBackoffOptions` or `FixedDelayOptions`. These options can then be used to configure a retry policy in the HTTP pipeline.\n\n```java\n// Using ExponentialBackoffOptions\n ExponentialBackoffOptions exponentialOptions = new ExponentialBackoffOptions()\n .setMaxRetries(5)\n .setBaseDelay(Duration.ofSeconds(1))\n .setMaxDelay(Duration.ofSeconds(10));\n RetryOptions retryOptions = new RetryOptions(exponentialOptions);\n\n // Using FixedDelayOptions\n FixedDelayOptions fixedOptions = new FixedDelayOptions(3, Duration.ofSeconds(1));\n RetryOptions retryOptions = new RetryOptions(fixedOptions);\n```"
|
|
metadata: {}
|
|
package: "com.azure.core.http.policy"
|
|
artifact: com.azure:azure-core:1.54.0
|