Package com.flagsmith.config
Class Retry
- java.lang.Object
-
- com.flagsmith.config.Retry
-
public class Retry extends Object
An implementation in Java for the Retry component of the Python urllib3 library. https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#urllib3.util.Retry
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LongcalculateSleepTime()The sleep time based on back off factor.BooleanisRetry(Integer statusCode)Should Retry or not?.voidretryAttempted()voidwaitWithBackoff()
-
-
-
Constructor Detail
-
Retry
public Retry(Integer total)
-
-
Method Detail
-
isRetry
public Boolean isRetry(Integer statusCode)
Should Retry or not?.- Parameters:
statusCode- status code of last call- Returns:
-
calculateSleepTime
public Long calculateSleepTime()
The sleep time based on back off factor.- Returns:
-
waitWithBackoff
public void waitWithBackoff() throws InterruptedException- Throws:
InterruptedException
-
retryAttempted
public void retryAttempted()
-
-