Class DigitalOcean2RateLimitRetryHandler
java.lang.Object
org.jclouds.http.handlers.RateLimitRetryHandler
org.jclouds.digitalocean2.handlers.DigitalOcean2RateLimitRetryHandler
- All Implemented Interfaces:
HttpRetryHandler
-
Field Summary
Fields inherited from class org.jclouds.http.handlers.RateLimitRetryHandler
logger
Fields inherited from interface org.jclouds.http.HttpRetryHandler
ALWAYS_RETRY, NEVER_RETRY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.google.common.base.Optional
<Long> millisToNextAvailableRequest
(HttpCommand command, HttpResponse response) Compute the number of milliseconds that must pass until a request can be performed.static long
millisUntilNextAvailableRequest
(long epochForNextAvailableRequest) Methods inherited from class org.jclouds.http.handlers.RateLimitRetryHandler
delayRequestUntilAllowed, getMaxRateLimitWait, getRetryCountLimit, rateLimitErrorStatus, shouldRetryRequest
-
Constructor Details
-
DigitalOcean2RateLimitRetryHandler
public DigitalOcean2RateLimitRetryHandler()
-
-
Method Details
-
millisToNextAvailableRequest
protected com.google.common.base.Optional<Long> millisToNextAvailableRequest(HttpCommand command, HttpResponse response) Description copied from class:RateLimitRetryHandler
Compute the number of milliseconds that must pass until a request can be performed.- Specified by:
millisToNextAvailableRequest
in classRateLimitRetryHandler
- Parameters:
command
- The command being executed.response
- The rate-limit error response.- Returns:
- The number of milliseconds to wait for an available request, if taht information is available.
-
millisUntilNextAvailableRequest
public static long millisUntilNextAvailableRequest(long epochForNextAvailableRequest)
-