public class DefaultRetryPolicy extends Object implements RetryPolicy
ClientConfiguration. This class is
immutable, therefore safe to be shared by multiple clients.ClientConfigurationDEFAULT_MAX_DELAY_IN_MILLIS, DEFAULT_MAX_ERROR_RETRY, DEFAULT_RETRY_POLICY| 构造器和说明 |
|---|
DefaultRetryPolicy()
Constructs a new DefaultRetryPolicy.
|
DefaultRetryPolicy(int maxErrorRetry,
long maxDelayInMillis)
Constructs a new retry policy.
|
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getDelayBeforeNextRetryInMillis(com.yeepay.yop.sdk.exception.YopClientException exception,
int retriesAttempted)
Returns the delay (in milliseconds) before next retry attempt.
|
long |
getMaxDelayInMillis()
Returns the maximum delay time (in milliseconds) before retrying a request.
|
int |
getMaxErrorRetry()
Returns the maximum number of retry attempts.
|
protected boolean |
shouldRetry(com.yeepay.yop.sdk.exception.YopClientException exception,
int retriesAttempted)
Returns whether a failed request should be retried according to the given request context.
|
public DefaultRetryPolicy()
public DefaultRetryPolicy(int maxErrorRetry,
long maxDelayInMillis)
maxErrorRetry - Maximum number of retry attempts for failed requests.maxDelayInMillis - Maximum delay time (in milliseconds) before next retry attempt.ClientConfigurationpublic int getMaxErrorRetry()
getMaxErrorRetry 在接口中 RetryPolicypublic long getMaxDelayInMillis()
getMaxDelayInMillis 在接口中 RetryPolicypublic long getDelayBeforeNextRetryInMillis(com.yeepay.yop.sdk.exception.YopClientException exception,
int retriesAttempted)
getDelayBeforeNextRetryInMillis 在接口中 RetryPolicyexception - the exception from the failed request, represented as an YopClientException object.retriesAttempted - the number of times the current request has been attempted
(not including the next attempt after the delay).protected boolean shouldRetry(com.yeepay.yop.sdk.exception.YopClientException exception,
int retriesAttempted)
exception - the exception from the failed request, represented as a YopClientException object.retriesAttempted - the number of times the current request has been attempted.Copyright © 2024. All rights reserved.