Package org.azd.abstractions.handlers
Class RetryHandler
java.lang.Object
org.azd.abstractions.handlers.RetryHandler
Retries the Api call based on Retry-After header value.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the default max retry value.<T> ApiResponse
retry
(ApiResponse response) Retries the Api call for the given Api response object.void
setDefaultMaxRetry
(int defaultMaxRetry) Sets the default max retry value.
-
Constructor Details
-
RetryHandler
-
-
Method Details
-
retry
Retries the Api call for the given Api response object. Determines the request information and retries the request for maximum of 6 times.- Type Parameters:
T
- Type parameter.- Parameters:
response
- Api response objectApiResponse
.- Returns:
- Retries Api response.
ApiResponse
.
-
getDefaultMaxRetry
public int getDefaultMaxRetry()Get the default max retry value.- Returns:
- Default retry value which is 6.
-
setDefaultMaxRetry
public void setDefaultMaxRetry(int defaultMaxRetry) Sets the default max retry value.- Parameters:
defaultMaxRetry
- Default value to set. The value can't be more than 6.
-