Class RetryOptions

java.lang.Object
com.microsoft.graph.httpcore.middlewareoption.RetryOptions
All Implemented Interfaces:
IMiddlewareControl

public class RetryOptions extends Object implements IMiddlewareControl
The options to be passed to the retry middleware.
  • Field Details

    • DEFAULT_SHOULD_RETRY

      public static final IShouldRetry DEFAULT_SHOULD_RETRY
      Default retry evaluation, always retry.
    • MAX_RETRIES

      public static final int MAX_RETRIES
      Absolute maximum number of retries
      See Also:
    • DEFAULT_MAX_RETRIES

      public static final int DEFAULT_MAX_RETRIES
      Default maximum number of retries
      See Also:
    • DEFAULT_DELAY

      public static final long DEFAULT_DELAY
      Default retry delay
      See Also:
    • MAX_DELAY

      public static final long MAX_DELAY
      Absolute maximum retry delay
      See Also:
  • Constructor Details

    • RetryOptions

      public RetryOptions()
      Create default instance of retry options, with default values of delay, max retries and shouldRetry callback.
    • RetryOptions

      public RetryOptions(@Nullable IShouldRetry shouldRetry, int maxRetries, long delay)
      Create an instance with provided values
      Parameters:
      shouldRetry - Retry callback to be called before making a retry
      maxRetries - Number of max retires for a request
      delay - Delay in seconds between retries
  • Method Details

    • shouldRetry

      @Nonnull public IShouldRetry shouldRetry()
      Returns:
      should retry callback
    • maxRetries

      public int maxRetries()
      Returns:
      Number of max retries
    • delay

      public long delay()
      Returns:
      Delay in seconds between retries