public class RequestCapStrategy extends Object
BrightpearlApiClient should use when a request cap error is
received from the Brightpearl API, in terms on the number of retries and wait between them. With a non-zero retryAttempts
value, all requests will be blocked while the first to fail is repeated until it succeeds. All waiting requests are then
sent.| Modifier and Type | Field and Description |
|---|---|
static RequestCapStrategy |
FAIL
Fail strategy: Do not attempt to repeat requests until they succeed; throw an exception for every failure.
|
static RequestCapStrategy |
RETRY
Default retry configuration: Make one attempt every 15 seconds and fail if 5 successive retries are blocked by the request cap.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getRetryAttempts()
For a retry strategy, returns the number of attempts that will be made to retry a request before aborting.
|
long |
getRetryWait()
For a retry strategy, returns the wait period between attempts.
|
static RequestCapStrategy |
retry(int retryAttempts,
long retryWait)
Constructs a retry strategy with a custom number of retry attempts and wait period in ms.
|
public static RequestCapStrategy RETRY
public static RequestCapStrategy FAIL
public static RequestCapStrategy retry(int retryAttempts, long retryWait)
retryAttempts - retryWait - public int getRetryAttempts()
public long getRetryWait()
Copyright © 2014. All Rights Reserved.