Class FixedDelay
- java.lang.Object
-
- com.azure.android.core.http.policy.FixedDelay
-
- All Implemented Interfaces:
RetryStrategy
public class FixedDelay extends java.lang.Object implements RetryStrategy
The retry strategy with fixed backoff delay.
-
-
Constructor Summary
Constructors Constructor Description FixedDelay(int maxRetries, org.threeten.bp.Duration delay)
CreatesFixedDelay
retry strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.threeten.bp.Duration
calculateRetryDelay(HttpResponse response, java.lang.Throwable error, int retryAttempts)
Determines the delay duration that should be waited before retrying.int
getMaxRetries()
Get the maximum number of times to retry.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.azure.android.core.http.policy.RetryStrategy
shouldRetry
-
-
-
-
Constructor Detail
-
FixedDelay
public FixedDelay(int maxRetries, org.threeten.bp.Duration delay)
CreatesFixedDelay
retry strategy.- Parameters:
maxRetries
- The maximum number of times to retry.delay
- The fixed backoff delay applied before every retry.- Throws:
java.lang.IllegalArgumentException
- ifmaxRetries
is less than 0.
-
-
Method Detail
-
getMaxRetries
public int getMaxRetries()
Description copied from interface:RetryStrategy
Get the maximum number of times to retry.- Specified by:
getMaxRetries
in interfaceRetryStrategy
- Returns:
- The maximum number of times to retry.
-
calculateRetryDelay
public org.threeten.bp.Duration calculateRetryDelay(HttpResponse response, java.lang.Throwable error, int retryAttempts)
Description copied from interface:RetryStrategy
Determines the delay duration that should be waited before retrying.- Specified by:
calculateRetryDelay
in interfaceRetryStrategy
- Parameters:
response
- The HTTP response.error
- The pipeline exception, if any.retryAttempts
- The number of retry attempts so far made.- Returns:
- The delay duration.
-
-