Package com.microsoft.rest.retry
Class RetryHandler
- java.lang.Object
-
- com.microsoft.rest.retry.RetryHandler
-
- All Implemented Interfaces:
okhttp3.Interceptor
public final class RetryHandler extends Object implements okhttp3.Interceptor
An instance of this interceptor placed in the request pipeline handles retriable errors.
-
-
Constructor Summary
Constructors Constructor Description RetryHandler()Initialized an instance ofRetryHandlerclass.RetryHandler(RetryStrategy retryStrategy)Initialized an instance ofRetryHandlerclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain)RetryStrategystrategy()
-
-
-
Constructor Detail
-
RetryHandler
public RetryHandler()
Initialized an instance ofRetryHandlerclass. Sets default retry strategy base on Exponential Backoff.
-
RetryHandler
public RetryHandler(RetryStrategy retryStrategy)
Initialized an instance ofRetryHandlerclass.- Parameters:
retryStrategy- retry strategy to use.
-
-
Method Detail
-
strategy
public RetryStrategy strategy()
- Returns:
- the strategy used by this handler
-
intercept
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException- Specified by:
interceptin interfaceokhttp3.Interceptor- Throws:
IOException
-
-