Class RetryProperties
java.lang.Object
co.yellowdog.platform.model.RetryProperties
Defines properties that control services client retry behaviour
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder that can be used to build a new RetryProperties that is automatically validated on build. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic RetryProperties.Builder
builder()
protected boolean
boolean
The initial interval before the first retry attempt.int
Set the number of attempts before retries are exhausted.The maximum interval between retry attempts.int
hashCode()
void
setInitialInterval
(Duration initialInterval) The initial interval before the first retry attempt.void
setMaxAttempts
(int maxAttempts) Set the number of attempts before retries are exhausted.void
setMaxInterval
(Duration maxInterval) The maximum interval between retry attempts.toString()
-
Field Details
-
DEFAULT_MAX_ATTEMPTS
public static final int DEFAULT_MAX_ATTEMPTSThe default max attempt count (3)- See Also:
-
DEFAULT_INITIAL_RETRY_INTERVAL
The default initial retry interval (5 seconds) -
DEFAULT_MAX_RETRY_INTERVAL
The default maximum retry interval (1 minute)
-
-
Method Details
-
builder
-
toBuilder
-
getMaxAttempts
public int getMaxAttempts()Set the number of attempts before retries are exhausted. Includes the initial attempt before the retries begin.- Returns:
- the number of attempts before retries are exhausted
-
getInitialInterval
The initial interval before the first retry attempt.- Returns:
- the initial interval before the first retry attempt
-
getMaxInterval
The maximum interval between retry attempts.- Returns:
- the maximum interval between retry attempts
-
setMaxAttempts
public void setMaxAttempts(int maxAttempts) Set the number of attempts before retries are exhausted. Includes the initial attempt before the retries begin.- Parameters:
maxAttempts
- the number of attempts before retries are exhausted
-
setInitialInterval
The initial interval before the first retry attempt.- Parameters:
initialInterval
- the initial interval before the first retry attempt
-
setMaxInterval
The maximum interval between retry attempts.- Parameters:
maxInterval
- the maximum interval between retry attempts
-
equals
-
canEqual
-
hashCode
-
toString
-