Class RetryHandler

java.lang.Object
com.microsoft.kiota.http.middleware.RetryHandler
All Implemented Interfaces:
okhttp3.Interceptor

public class RetryHandler extends Object implements okhttp3.Interceptor
The middleware responsible for retrying requests when they fail because of transient issues
  • Field Details

    • MSClientErrorCodeTooManyRequests

      public static final int MSClientErrorCodeTooManyRequests
      Too many requests status code
      See Also:
    • MSClientErrorCodeServiceUnavailable

      public static final int MSClientErrorCodeServiceUnavailable
      Service unavailable status code
      See Also:
    • MSClientErrorCodeGatewayTimeout

      public static final int MSClientErrorCodeGatewayTimeout
      Gateway timeout status code
      See Also:
  • Constructor Details

    • RetryHandler

      public RetryHandler(@Nullable RetryHandlerOption retryOption)
      Initialize retry handler with retry option
      Parameters:
      retryOption - Create Retry handler using retry option
    • RetryHandler

      public RetryHandler()
      Initialize retry handler with default retry option
  • Method Details

    • getRetryOptions

      @Nonnull public RetryHandlerOption getRetryOptions()
      Gets the retry options in use by the handler.
      Returns:
      the retry options in use by the handler.
    • intercept

      @Nonnull public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException
      Specified by:
      intercept in interface okhttp3.Interceptor
      Throws:
      IOException