Class 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 Detail

      • RetryHandler

        public RetryHandler()
        Initialized an instance of RetryHandler class. Sets default retry strategy base on Exponential Backoff.
      • RetryHandler

        public RetryHandler​(RetryStrategy retryStrategy)
        Initialized an instance of RetryHandler class.
        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:
        intercept in interface okhttp3.Interceptor
        Throws:
        IOException