public abstract class RetryPolicy
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
msBeforeRetry |
| Constructor and Description |
|---|
RetryPolicy(int msBeforeRetry)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
getRetryTimeInMs()
Get the retry time
|
void |
retry(ConnectionState state,
RetryHandler retryHandler,
ConnectionFailHandler failHandler)
Does the retry.
|
abstract boolean |
shouldRetry(ConnectionState connectionState)
Should another retry be attempted according to the policy
|
public RetryPolicy(int msBeforeRetry)
msBeforeRetry - milliseconds before trying retrypublic void retry(ConnectionState state, RetryHandler retryHandler, ConnectionFailHandler failHandler)
state - of connectionretryHandler - handles the retry itselffailHandler - handles the failpublic int getRetryTimeInMs()
public abstract boolean shouldRetry(ConnectionState connectionState)
connectionState - current connection state