Package com.azure.core.http.policy
Class FixedDelay
- java.lang.Object
-
- com.azure.core.http.policy.FixedDelay
-
- All Implemented Interfaces:
RetryStrategy
public class FixedDelay extends Object implements RetryStrategy
A fixed-delay implementation ofRetryStrategy
that has a fixed delay duration between each retry attempt.
-
-
Field Summary
-
Fields inherited from interface com.azure.core.http.policy.RetryStrategy
HTTP_STATUS_TOO_MANY_REQUESTS
-
-
Constructor Summary
Constructors Constructor Description FixedDelay(int maxRetries, Duration delay)
Creates an instance ofFixedDelay
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Duration
calculateRetryDelay(int retryAttempts)
Computes the delay between each retry.int
getMaxRetries()
Max number of retry attempts to be make.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.azure.core.http.policy.RetryStrategy
shouldRetry, shouldRetryException
-
-
-
-
Constructor Detail
-
FixedDelay
public FixedDelay(int maxRetries, Duration delay)
Creates an instance ofFixedDelay
.- Parameters:
maxRetries
- The max number of retry attempts that can be made.delay
- The fixed delay duration between retry attempts.
-
-
Method Detail
-
getMaxRetries
public int getMaxRetries()
Description copied from interface:RetryStrategy
Max number of retry attempts to be make.- Specified by:
getMaxRetries
in interfaceRetryStrategy
- Returns:
- The max number of retry attempts.
-
calculateRetryDelay
public Duration calculateRetryDelay(int retryAttempts)
Description copied from interface:RetryStrategy
Computes the delay between each retry.- Specified by:
calculateRetryDelay
in interfaceRetryStrategy
- Parameters:
retryAttempts
- The number of retry attempts completed so far.- Returns:
- The delay duration before the next retry.
-
-