Package org.jclouds.http.handlers
Class DelegatingRetryHandler
- java.lang.Object
-
- org.jclouds.http.handlers.DelegatingRetryHandler
-
- All Implemented Interfaces:
HttpRetryHandler
@Singleton public class DelegatingRetryHandler extends Object implements HttpRetryHandler
Delegates toHttpRetryHandlers
who are annotated according to the response codes they relate to.
-
-
Field Summary
-
Fields inherited from interface org.jclouds.http.HttpRetryHandler
ALWAYS_RETRY, NEVER_RETRY
-
-
Constructor Summary
Constructors Constructor Description DelegatingRetryHandler(BackoffLimitedRetryHandler backOff, RedirectionRetryHandler redirectionRetryHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpRetryHandler
getClientErrorRetryHandler()
HttpRetryHandler
getRedirectionRetryHandler()
HttpRetryHandler
getServerErrorRetryHandler()
boolean
shouldRetryRequest(HttpCommand command, HttpResponse response)
Return true if the command should be retried.
-
-
-
Constructor Detail
-
DelegatingRetryHandler
@Inject public DelegatingRetryHandler(BackoffLimitedRetryHandler backOff, RedirectionRetryHandler redirectionRetryHandler)
-
-
Method Detail
-
shouldRetryRequest
public boolean shouldRetryRequest(HttpCommand command, HttpResponse response)
Description copied from interface:HttpRetryHandler
Return true if the command should be retried. This method should only be invoked when the response has failed with a HTTP 5xx error indicating a server-side error.- Specified by:
shouldRetryRequest
in interfaceHttpRetryHandler
-
getRedirectionRetryHandler
public HttpRetryHandler getRedirectionRetryHandler()
-
getClientErrorRetryHandler
public HttpRetryHandler getClientErrorRetryHandler()
-
getServerErrorRetryHandler
public HttpRetryHandler getServerErrorRetryHandler()
-
-