Interface IRetryStrategy

  • All Known Implementing Classes:
    DefaultRetryStrategy

    public interface IRetryStrategy
    IRetryStrategy is an interface that is implemented by retry interceptor factories. This interface is used by the java core to create a retry interceptor implementation when automatic retries are enabled. The java core defines a default implementation of this interface in the DefaultRetryStrategy class. Users can implement their own factory in order to supply their own retry interceptor implementation, perhaps to customize the criteria under which failed requests will be retried.
    • Method Detail

      • createRetryInterceptor

        IRetryInterceptor createRetryInterceptor​(int maxRetries,
                                                 int maxRetryInterval,
                                                 Authenticator authenticator)
        Return an implementation of the IRetryInterceptor interface that is capable of retrying failed requests.
        Parameters:
        maxRetries - the maximum number of retries to be attempted by the retry interceptor
        maxRetryInterval - the maximum interval (in seconds)
        authenticator - the Authenticator instance to be used to authenticate retried requests
        Returns:
        an okhttp3.Interceptor instance