Package com.oracle.bmc.retrier
Class DefaultRetryCondition
- java.lang.Object
-
- com.oracle.bmc.retrier.DefaultRetryCondition
-
- All Implemented Interfaces:
RetryCondition
- Direct Known Subclasses:
RetryOnOpenCircuitBreakerDefaultRetryCondition
public class DefaultRetryCondition extends Object implements RetryCondition
Class that represents the conditions documented in https://docs.oracle.com/iaas/Content/API/References/apierrors.htm for which the operation may be retried.
-
-
Constructor Summary
Constructors Constructor Description DefaultRetryCondition()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanisProcessingException(BmcException exception)booleanshouldBeRetried(BmcException exception)Check if the operation should be retried based on the givenBmcException.
-
-
-
Method Detail
-
shouldBeRetried
public boolean shouldBeRetried(@Nonnull BmcException exception)Check if the operation should be retried based on the givenBmcException.The operation will be retried if:
- The exception is client-side and not caused by a
CallNotAllowedException. - The exception is a timeout.
- The HTTP status code is 429, 500, 502, 503, or 504.
- The HTTP status code and service code are in the
RETRYABLE_SERVICE_ERRORSmap. - The exception is a "processing exception" and token refresh retry is enabled.
- Specified by:
shouldBeRetriedin interfaceRetryCondition- Parameters:
exception- The exception from the previous unsuccessful operation.- Returns:
- true if the operation should be retried, else false.
- The exception is client-side and not caused by a
-
isProcessingException
public static boolean isProcessingException(BmcException exception)
-
-