RetryOptions Class

  • java.lang.Object
    • com.microsoft.graph.httpcore.middlewareoption.RetryOptions

Implements

public class RetryOptions
implements IMiddlewareControl

The options to be passed to the retry middleware.

Field Summary

Modifier and Type Field and Description
static final long DEFAULT_DELAY

Default retry delay

static final int DEFAULT_MAX_RETRIES

Default maximum number of retries

static final IShouldRetry DEFAULT_SHOULD_RETRY

Default retry evaluation, always retry.

static final long MAX_DELAY

Absolute maximum retry delay

static final int MAX_RETRIES

Absolute maximum number of retries

Constructor Summary

Constructor Description
RetryOptions()

Create default instance of retry options, with default values of delay, max retries and shouldRetry callback.

RetryOptions(IShouldRetry shouldRetry, int maxRetries, long delay)

Create an instance with provided values

Method Summary

Modifier and Type Method and Description
long delay()
int maxRetries()
IShouldRetry shouldRetry()

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

DEFAULT_DELAY

public static final long DEFAULT_DELAY

Default retry delay

DEFAULT_MAX_RETRIES

public static final int DEFAULT_MAX_RETRIES

Default maximum number of retries

DEFAULT_SHOULD_RETRY

public static final IShouldRetry DEFAULT_SHOULD_RETRY

Default retry evaluation, always retry.

MAX_DELAY

public static final long MAX_DELAY

Absolute maximum retry delay

MAX_RETRIES

public static final int MAX_RETRIES

Absolute maximum number of retries

Constructor Details

RetryOptions

public RetryOptions()

Create default instance of retry options, with default values of delay, max retries and shouldRetry callback.

RetryOptions

public RetryOptions(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

delay

public long delay()

Returns:

Delay in seconds between retries

maxRetries

public int maxRetries()

Returns:

Number of max retries

shouldRetry

public IShouldRetry shouldRetry()

Returns:

should retry callback

Applies to