Package io.temporal.common
Class RetryOptions
- java.lang.Object
-
- io.temporal.common.RetryOptions
-
public final class RetryOptions extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RetryOptions.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
calculateSleepTime(long attempt)
boolean
equals(java.lang.Object o)
double
getBackoffCoefficient()
static RetryOptions
getDefaultInstance()
java.lang.String[]
getDoNotRetry()
java.time.Duration
getInitialInterval()
int
getMaximumAttempts()
java.time.Duration
getMaximumInterval()
int
hashCode()
static RetryOptions
merge(MethodRetry r, RetryOptions o)
Merges annotation with explicitly provided RetryOptions.RetryOptions
merge(RetryOptions o)
The parameter options takes precedence.static RetryOptions.Builder
newBuilder()
static RetryOptions.Builder
newBuilder(RetryOptions options)
Creates builder with fields pre-populated from passed options.boolean
shouldRethrow(java.lang.Throwable e, java.util.Optional<java.time.Duration> expiration, long attempt, long elapsed, long sleepTime)
RetryOptions.Builder
toBuilder()
java.lang.String
toString()
-
-
-
Method Detail
-
newBuilder
public static RetryOptions.Builder newBuilder()
-
newBuilder
public static RetryOptions.Builder newBuilder(RetryOptions options)
Creates builder with fields pre-populated from passed options.- Parameters:
options
- can be null
-
getDefaultInstance
public static RetryOptions getDefaultInstance()
-
merge
public static RetryOptions merge(MethodRetry r, RetryOptions o)
Merges annotation with explicitly provided RetryOptions. If there is conflict RetryOptions takes precedence.
-
merge
public RetryOptions merge(RetryOptions o)
The parameter options takes precedence.
-
getInitialInterval
public java.time.Duration getInitialInterval()
-
getBackoffCoefficient
public double getBackoffCoefficient()
-
getMaximumAttempts
public int getMaximumAttempts()
-
getMaximumInterval
public java.time.Duration getMaximumInterval()
-
getDoNotRetry
public java.lang.String[] getDoNotRetry()
- Returns:
- null if not configured. When merging with annotation it makes a difference. null means use values from an annotation. Empty list means do not retry on anything.
-
toBuilder
public RetryOptions.Builder toBuilder()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
calculateSleepTime
public long calculateSleepTime(long attempt)
-
shouldRethrow
public boolean shouldRethrow(java.lang.Throwable e, java.util.Optional<java.time.Duration> expiration, long attempt, long elapsed, long sleepTime)
-
-