Class RetryHandler

java.lang.Object
org.azd.abstractions.handlers.RetryHandler

public class RetryHandler extends Object
Retries the Api call based on Retry-After header value.
  • Constructor Details

  • Method Details

    • retry

      public <T> ApiResponse retry(ApiResponse response)
      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 object ApiResponse.
      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.