Class RetryOnExceptionsCondition
- java.lang.Object
-
- software.amazon.awssdk.core.retry.conditions.RetryOnExceptionsCondition
-
- All Implemented Interfaces:
RetryCondition
public final class RetryOnExceptionsCondition extends Object implements RetryCondition
Retry condition implementation that retries if the exception or the cause of the exception matches the classes defined.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RetryOnExceptionsCondition
create(Class<? extends Exception>... exceptionsToRetryOn)
static RetryOnExceptionsCondition
create(Set<Class<? extends Exception>> exceptionsToRetryOn)
boolean
equals(Object o)
int
hashCode()
boolean
shouldRetry(RetryPolicyContext context)
Determine whether a request should or should not be retried.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.core.retry.conditions.RetryCondition
requestSucceeded, requestWillNotBeRetried
-
-
-
-
Method Detail
-
shouldRetry
public boolean shouldRetry(RetryPolicyContext context)
Description copied from interface:RetryCondition
Determine whether a request should or should not be retried.- Specified by:
shouldRetry
in interfaceRetryCondition
- Parameters:
context
- Context about the state of the last request and information about the number of requests made.- Returns:
- True if the exception class or the cause of the exception matches one of the exceptions supplied at initialization time.
-
create
public static RetryOnExceptionsCondition create(Set<Class<? extends Exception>> exceptionsToRetryOn)
- Parameters:
exceptionsToRetryOn
- Exception classes to retry on.
-
create
public static RetryOnExceptionsCondition create(Class<? extends Exception>... exceptionsToRetryOn)
- Parameters:
exceptionsToRetryOn
- Exception classes to retry on.
-
-