Interface RetryClient<T>
- All Known Subinterfaces:
DsfClient, PreferReturnMinimalWithRetry, PreferReturnOutcomeWithRetry
public interface RetryClient<T>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault Tretries once after a delay ofFIVE_SECONDSdefault TwithRetry(int nTimes) retries nTimes and waitsFIVE_SECONDSbetween trieswithRetry(int nTimes, DelayStrategy delayStrategy) default Tretries once after the given delaywithRetryForever(DelayStrategy delayStrategy)
-
Field Details
-
RETRY_ONCE
static final int RETRY_ONCE- See Also:
-
RETRY_FOREVER
static final int RETRY_FOREVER- See Also:
-
FIVE_SECONDS
-
-
Method Details
-
withRetry
-
withRetry
retries nTimes and waitsFIVE_SECONDSbetween tries- Parameters:
nTimes->= 0- Returns:
- T
- Throws:
IllegalArgumentException- if given nTimes is<0
-
withRetry
retries once after the given delay- Parameters:
delay- notnull, notDuration.isNegative()- Returns:
- T
- Throws:
IllegalArgumentException- if given delay isnullorDuration.isNegative()
-
withRetry
- Parameters:
nTimes->= 0delayStrategy- notnull- Returns:
- T
- Throws:
IllegalArgumentException- if given nTimes or delay isnullorDuration.isNegative()
-
withRetryForever
- Parameters:
delayStrategy- notnull- Returns:
- T
- Throws:
IllegalArgumentException- if given delay isnullorDuration.isNegative()
-