public abstract class RetryPolicy extends Object
Modifier | Constructor and Description |
---|---|
protected |
RetryPolicy(String name) |
Modifier and Type | Method and Description |
---|---|
static RetryPolicy |
getDefault() |
Duration |
getNextRetryInterval(String clientId,
Exception lastException,
Duration remainingTime)
Gets the Interval after which nextRetry should be done.
|
static RetryPolicy |
getNoRetry() |
protected int |
getRetryCount(String clientId) |
void |
incrementRetryCount(String clientId) |
static boolean |
isRetryableException(Exception exception) |
protected abstract Duration |
onGetNextRetryInterval(String clientId,
Exception lastException,
Duration remainingTime,
int baseWaitTime) |
void |
resetRetryCount(String clientId) |
String |
toString() |
protected RetryPolicy(String name)
public void incrementRetryCount(String clientId)
public void resetRetryCount(String clientId)
public static boolean isRetryableException(Exception exception)
public static RetryPolicy getDefault()
public static RetryPolicy getNoRetry()
protected int getRetryCount(String clientId)
public Duration getNextRetryInterval(String clientId, Exception lastException, Duration remainingTime)
clientId
- clientIdlastException
- lastExceptionremainingTime
- remainingTime to retryprotected abstract Duration onGetNextRetryInterval(String clientId, Exception lastException, Duration remainingTime, int baseWaitTime)
Copyright © 2017. All rights reserved.