RetryHandler Class

  • java.lang.Object
    • com.microsoft.graph.httpcore.RetryHandler

Implements

okhttp3.Interceptor

public class RetryHandler
implements okhttp3.Interceptor

The middleware responsible for retrying requests when they fail because of transient issues

Field Summary

Modifier and Type Field and Description
final MiddlewareType MIDDLEWARE_TYPE

Type of the current middleware

static final int MSClientErrorCodeGatewayTimeout

Gateway timeout status code

static final int MSClientErrorCodeServiceUnavailable

Service unavailable status code

static final int MSClientErrorCodeTooManyRequests

Too many requests status code

Constructor Summary

Constructor Description
RetryHandler()

Initialize retry handler with default retry option

RetryHandler(RetryOptions retryOption)
RetryHandler(ILogger logger, RetryOptions retryOption)

Method Summary

Modifier and Type Method and Description
okhttp3.Response intercept(Interceptor.Chain chain)

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Field Details

MIDDLEWARE_TYPE

public final MiddlewareType MIDDLEWARE_TYPE

Type of the current middleware

MSClientErrorCodeGatewayTimeout

public static final int MSClientErrorCodeGatewayTimeout

Gateway timeout status code

MSClientErrorCodeServiceUnavailable

public static final int MSClientErrorCodeServiceUnavailable

Service unavailable status code

MSClientErrorCodeTooManyRequests

public static final int MSClientErrorCodeTooManyRequests

Too many requests status code

Constructor Details

RetryHandler

public RetryHandler()

Initialize retry handler with default retry option

RetryHandler

public RetryHandler(RetryOptions retryOption)

Parameters:

retryOption - Create Retry handler using retry option

RetryHandler

public RetryHandler(ILogger logger, RetryOptions retryOption)

Parameters:

logger - logger to use for telemetry
retryOption - Create Retry handler using retry option

Method Details

intercept

public Response intercept(Interceptor.Chain chain)

Parameters:

chain

Throws:

java.io.IOException

Applies to