Package com.tnsai.idempotency
Enum Class RetryBehavior
- All Implemented Interfaces:
Serializable,Comparable<RetryBehavior>,Constable
What the framework does when a retry hits a previously-stored
idempotency entry (issue #91).
- Since:
- 0.5.0 (issue #91)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA retry hitting the cache is a hard error — throwIdempotencyException.Return the cached result; skip re-execution.Return the cached result only if the original attempt succeeded. -
Method Summary
Modifier and TypeMethodDescriptionstatic RetryBehaviorReturns the enum constant of this class with the specified name.static RetryBehavior[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
RETURN_CACHED
Return the cached result; skip re-execution. Default for most tools — exactly the side-effect-deduplication semantic the feature exists for. -
RETURN_CACHED_IF_SUCCESS
Return the cached result only if the original attempt succeeded. If the cached entry is a failure, skip the cache and let the tool re-run. Useful when the original failure was transient and the consumer prefers another shot over a permanently-cached error. -
FAIL_FAST
A retry hitting the cache is a hard error — throwIdempotencyException. Use when the caller wants to be told "this call already happened" rather than silently get the prior result (e.g. financial reconciliation tools where double-attempts are themselves a signal of upstream confusion).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-