azure-docs-sdk-java/docs-ref-autogen/com.azure.core.http.policy....

65 строки
5.1 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.core.http.policy.FixedDelayOptions"
fullName: "com.azure.core.http.policy.FixedDelayOptions"
name: "FixedDelayOptions"
nameWithType: "FixedDelayOptions"
summary: "The `FixedDelayOptions` class provides configuration options for the <xref uid=\"com.azure.core.http.policy.FixedDelay\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FixedDelay\"></xref> retry strategy."
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 **FixedDelayOptions**"
constructors:
- uid: "com.azure.core.http.policy.FixedDelayOptions.FixedDelayOptions(int,java.time.Duration)"
fullName: "com.azure.core.http.policy.FixedDelayOptions.FixedDelayOptions(int maxRetries, Duration delay)"
name: "FixedDelayOptions(int maxRetries, Duration delay)"
nameWithType: "FixedDelayOptions.FixedDelayOptions(int maxRetries, Duration delay)"
summary: "Creates an instance of <xref uid=\"com.azure.core.http.policy.FixedDelayOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FixedDelayOptions\"></xref>."
parameters:
- description: "The max number of retry attempts that can be made."
name: "maxRetries"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "The fixed delay duration between retry attempts."
name: "delay"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public FixedDelayOptions(int maxRetries, Duration delay)"
desc: "Creates an instance of <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.FixedDelayOptions.getDelay()"
fullName: "com.azure.core.http.policy.FixedDelayOptions.getDelay()"
name: "getDelay()"
nameWithType: "FixedDelayOptions.getDelay()"
summary: "Gets the max retry attempts that can be made."
syntax: "public Duration getDelay()"
desc: "Gets the max retry attempts that can be made."
returns:
description: "The max retry attempts that can be made."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- uid: "com.azure.core.http.policy.FixedDelayOptions.getMaxRetries()"
fullName: "com.azure.core.http.policy.FixedDelayOptions.getMaxRetries()"
name: "getMaxRetries()"
nameWithType: "FixedDelayOptions.getMaxRetries()"
summary: "Gets the max retry attempts that can be made."
syntax: "public int getMaxRetries()"
desc: "Gets the max retry attempts that can be made."
returns:
description: "The max retry attempts that can be made."
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "The `FixedDelayOptions` class provides configuration options for the <xref uid=\"com.azure.core.http.policy.FixedDelay\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FixedDelay\"></xref> retry strategy. This strategy uses a fixed delay duration between each retry attempt.\n\nThis class is useful when you need to customize the behavior of the fixed delay retry strategy. It allows you to specify the maximum number of retry attempts and the delay duration between each attempt.\n\n**Code sample:**\n\nIn this example, a `FixedDelayOptions` is created and used to configure a `FixedDelay` retry strategy. The strategy is then used in a `RetryPolicy` which can then be added to the pipeline. For a request then sent by the pipeline, if the server responds with a transient error, the request will be retried with a fixed delay between each attempt.\n\n```java\nFixedDelayOptions options = new FixedDelayOptions(3, Duration.ofSeconds(1));\n FixedDelay retryStrategy = new FixedDelay(options);\n```"
metadata: {}
package: "com.azure.core.http.policy"
artifact: com.azure:azure-core:1.52.0