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 classRetryOptions.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longcalculateSleepTime(long attempt)booleanequals(java.lang.Object o)doublegetBackoffCoefficient()static RetryOptionsgetDefaultInstance()java.lang.String[]getDoNotRetry()java.time.DurationgetInitialInterval()intgetMaximumAttempts()java.time.DurationgetMaximumInterval()inthashCode()static RetryOptionsmerge(MethodRetry r, RetryOptions o)Merges annotation with explicitly provided RetryOptions.RetryOptionsmerge(RetryOptions o)The parameter options takes precedence.static RetryOptions.BuildernewBuilder()static RetryOptions.BuildernewBuilder(RetryOptions options)Creates builder with fields pre-populated from passed options.booleanshouldRethrow(java.lang.Throwable e, java.util.Optional<java.time.Duration> expiration, long attempt, long elapsed, long sleepTime)RetryOptions.BuildertoBuilder()java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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)
-
-