Package com.azure.core.http.policy
Class ExponentialBackoffOptions
- java.lang.Object
-
- com.azure.core.http.policy.ExponentialBackoffOptions
-
public class ExponentialBackoffOptions extends Object
The configuration for exponential backoff that has a delay duration that exponentially increases with each retry attempt until an upper bound is reached after which every retry attempt is delayed by the provided max delay duration.
-
-
Constructor Summary
Constructors Constructor Description ExponentialBackoffOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DurationgetBaseDelay()Gets the base delay duration for retry.DurationgetMaxDelay()Gets the max delay duration for retry.IntegergetMaxRetries()Gets the max retry attempts that can be made.ExponentialBackoffOptionssetBaseDelay(Duration baseDelay)Sets the base delay duration for retry.ExponentialBackoffOptionssetMaxDelay(Duration maxDelay)Sets the max delay duration for retry.ExponentialBackoffOptionssetMaxRetries(Integer maxRetries)Sets the max retry attempts that can be made.
-
-
-
Method Detail
-
getMaxRetries
public Integer getMaxRetries()
Gets the max retry attempts that can be made.- Returns:
- The max retry attempts that can be made.
-
setMaxRetries
public ExponentialBackoffOptions setMaxRetries(Integer maxRetries)
Sets the max retry attempts that can be made.- Parameters:
maxRetries- the max retry attempts that can be made.- Returns:
- The updated
ExponentialBackoffOptions - Throws:
IllegalArgumentException- ifmaxRetriesis less than 0.
-
getBaseDelay
public Duration getBaseDelay()
Gets the base delay duration for retry.- Returns:
- The base delay duration for retry.
-
setBaseDelay
public ExponentialBackoffOptions setBaseDelay(Duration baseDelay)
Sets the base delay duration for retry.- Parameters:
baseDelay- the base delay duration for retry.- Returns:
- The updated
ExponentialBackoffOptions - Throws:
IllegalArgumentException- ifbaseDelayis less than or equal to 0 ormaxDelayhas been set and is less thanbaseDelay.
-
getMaxDelay
public Duration getMaxDelay()
Gets the max delay duration for retry.- Returns:
- The max delay duration for retry.
-
setMaxDelay
public ExponentialBackoffOptions setMaxDelay(Duration maxDelay)
Sets the max delay duration for retry.- Parameters:
maxDelay- the max delay duration for retry.- Returns:
- The updated
ExponentialBackoffOptions - Throws:
IllegalArgumentException- ifmaxDelayis less than or equal to 0 orbaseDelayhas been set and is more thanmaxDelay.
-
-