Class AwsRetryStrategy
- java.lang.Object
-
- software.amazon.awssdk.awscore.retry.AwsRetryStrategy
-
public final class AwsRetryStrategy extends Object
Retry strategies used by clients when communicating with AWS services.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AdaptiveRetryStrategy
adaptiveRetryStrategy()
Returns anAdaptiveRetryStrategy
with AWS-specific conditions added.static RetryStrategy
addRetryConditions(RetryStrategy strategy)
Update the providedRetryStrategy
to add AWS-specific conditions.static <T extends RetryStrategy.Builder<T,?>>
Tconfigure(T builder)
Configures a retry strategy using its builder to add AWS-specific retry exceptions.static RetryStrategy.Builder<?,?>
configureStrategy(RetryStrategy.Builder<?,?> builder)
Configures any retry strategy using its builder to add AWS-specific retry exceptions.static RetryStrategy
defaultRetryStrategy()
Retrieve theSdkDefaultRetryStrategy.defaultRetryStrategy()
with AWS-specific conditions added.static RetryStrategy
doNotRetry()
Returns a retry strategy that does not retry.static RetryStrategy
forRetryMode(RetryMode mode)
Retrieve the appropriate retry strategy for the retry mode with AWS-specific conditions added.static LegacyRetryStrategy
legacyRetryStrategy()
Returns aLegacyRetryStrategy
with AWS-specific conditions added.static StandardRetryStrategy
standardRetryStrategy()
Returns aStandardRetryStrategy
with AWS-specific conditions added.
-
-
-
Method Detail
-
defaultRetryStrategy
public static RetryStrategy defaultRetryStrategy()
Retrieve theSdkDefaultRetryStrategy.defaultRetryStrategy()
with AWS-specific conditions added.- Returns:
- The default retry strategy.
-
forRetryMode
public static RetryStrategy forRetryMode(RetryMode mode)
Retrieve the appropriate retry strategy for the retry mode with AWS-specific conditions added.- Parameters:
mode
- The retry mode for which we want to create a retry strategy.- Returns:
- A retry strategy for the given retry mode.
-
addRetryConditions
public static RetryStrategy addRetryConditions(RetryStrategy strategy)
Update the providedRetryStrategy
to add AWS-specific conditions.- Parameters:
strategy
- The strategy to update- Returns:
- The updated strategy.
-
doNotRetry
public static RetryStrategy doNotRetry()
Returns a retry strategy that does not retry.- Returns:
- A retry strategy that do not retry.
-
standardRetryStrategy
public static StandardRetryStrategy standardRetryStrategy()
Returns aStandardRetryStrategy
with AWS-specific conditions added.- Returns:
- A
StandardRetryStrategy
with AWS-specific conditions added.
-
legacyRetryStrategy
public static LegacyRetryStrategy legacyRetryStrategy()
Returns aLegacyRetryStrategy
with AWS-specific conditions added.- Returns:
- A
LegacyRetryStrategy
with AWS-specific conditions added.
-
adaptiveRetryStrategy
public static AdaptiveRetryStrategy adaptiveRetryStrategy()
Returns anAdaptiveRetryStrategy
with AWS-specific conditions added.- Returns:
- An
AdaptiveRetryStrategy
with AWS-specific conditions added.
-
configure
public static <T extends RetryStrategy.Builder<T,?>> T configure(T builder)
Configures a retry strategy using its builder to add AWS-specific retry exceptions.- Type Parameters:
T
- The type of the builder extendingRetryStrategy.Builder
- Parameters:
builder
- The builder to add the AWS-specific retry exceptions- Returns:
- The given builder
-
configureStrategy
public static RetryStrategy.Builder<?,?> configureStrategy(RetryStrategy.Builder<?,?> builder)
Configures any retry strategy using its builder to add AWS-specific retry exceptions.- Parameters:
builder
- The builder to add the AWS-specific retry exceptions- Returns:
- The given builder
-
-