RetryStrategy Class
- java.
lang. Object - com.
microsoft. bot. restclient. retry. RetryStrategy
- com.
public abstract class RetryStrategy
Represents a retry strategy that determines the number of retry attempts and the interval between retries.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| static final int |
DEFAULT_CLIENT_RETRY_COUNT
Represents the default number of retry attempts. |
| static final boolean |
DEFAULT_FIRST_FAST_RETRY
Represents the default flag indicating whether the first retry attempt will be made immediately, whereas subsequent retries will remain subject to the retry interval. |
| static final int |
DEFAULT_RETRY_INTERVAL
Represents the default interval between retries. |
Constructor Summary
| Modifier | Constructor | Description |
|---|---|---|
| protected | RetryStrategy(String name, boolean firstFastRetry) |
Initializes a new instance of the RetryStrategy class. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| boolean |
isFastFirstRetry()
Gets whether the first retry attempt will be made immediately. |
| java.lang.String |
name()
Gets the name of the retry strategy. |
| abstract boolean |
shouldRetry(int retryCount, Response response)
Returns if a request should be retried based on the retry count, current response, and the current strategy. |
Methods inherited from java.lang.Object
Field Details
DEFAULT_CLIENT_RETRY_COUNT
public static final int DEFAULT_CLIENT_RETRY_COUNT
Represents the default number of retry attempts.
DEFAULT_FIRST_FAST_RETRY
public static final boolean DEFAULT_FIRST_FAST_RETRY
Represents the default flag indicating whether the first retry attempt will be made immediately, whereas subsequent retries will remain subject to the retry interval.
DEFAULT_RETRY_INTERVAL
public static final int DEFAULT_RETRY_INTERVAL
Represents the default interval between retries.
Constructor Details
RetryStrategy
protected RetryStrategy(String name, boolean firstFastRetry)
Initializes a new instance of the RetryStrategy class.
Parameters:
Method Details
isFastFirstRetry
public boolean isFastFirstRetry()
Gets whether the first retry attempt will be made immediately.
Returns:
name
public String name()
Gets the name of the retry strategy.
Returns:
shouldRetry
public abstract boolean shouldRetry(int retryCount, Response response)
Returns if a request should be retried based on the retry count, current response, and the current strategy.
Parameters:
Returns: