Class RetryHandler

java.lang.Object
com.microsoft.graph.httpcore.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

    • MIDDLEWARE_TYPE

      public final MiddlewareType MIDDLEWARE_TYPE
      Type of the current middleware
    • 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 RetryOptions retryOption)
      Parameters:
      retryOption - Create Retry handler using retry option
    • RetryHandler

      public RetryHandler(@Nonnull ILogger logger, @Nullable RetryOptions retryOption)
      Parameters:
      logger - logger to use for telemetry
      retryOption - Create Retry handler using retry option
    • RetryHandler

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

    • intercept

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