| java.lang.Object | |
| ↳ | com.neomades.content.retry.DefaultRetryPolicy |
Default retry policy for queries.
The default retry policy has three characteristics:
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
DefaultRetryPolicy()
Constructs a new retry policy using the default values.
| |||||||||||
|
DefaultRetryPolicy(int initialTimeoutMs, int maxNumRetries, float backoffMultiplier)
Constructs a new retry policy.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int |
getCurrentRetryCount()
Returns the current retry count (this getter is used for logging).
| ||||||||||
| int |
getCurrentTimeout()
Returns the current timeout (this getter is used for logging).
| ||||||||||
| void |
retry(ContentError error)
Prepares for the next retry by applying a backoff to the timeout.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.neomades.content.retry.RetryPolicy
| |||||||||||
Constructs a new retry policy using the default values.
Constructs a new retry policy.
| initialTimeoutMs | The initial timeout for the policy. |
|---|---|
| maxNumRetries | The maximum number of retries. |
| backoffMultiplier | Backoff multiplier for the policy. |
Returns the current retry count (this getter is used for logging).
This getter is used by ContentManager to print out to the console
(for logging), after how many retry count the query is retrying.
This value should be used and updated by RetryPolicy implementation.
Returns the current timeout (this getter is used for logging).
This getter is used by ContentManager to print out to the console
(for logging), after which timeout the query is retrying.
This value should be used and updated by RetryPolicy implementation.
Prepares for the next retry by applying a backoff to the timeout.
Current timeout will increase each time this method will be called. If the max number of retries has been reached this method will throw an exception to stop retrying.
| error | The error of the last attempt. |
|---|