Package com.tnsai.idempotency
Enum Class IdempotencyException.IdempotencyConflict
java.lang.Object
java.lang.Enum<IdempotencyException.IdempotencyConflict>
com.tnsai.idempotency.IdempotencyException.IdempotencyConflict
- All Implemented Interfaces:
Serializable,Comparable<IdempotencyException.IdempotencyConflict>,Constable
- Enclosing class:
IdempotencyException
public static enum IdempotencyException.IdempotencyConflict
extends Enum<IdempotencyException.IdempotencyConflict>
Why the idempotency-protected call could not be resolved. Each
value implies a different operator-facing posture:
FAIL_FAST_HIT is "your application already tried this";
KEY_COLLISION_DIFFERENT_INPUT is "two distinct calls
hashed to the same key" (astronomically unlikely with SHA-256
but guarded against because the cost of allowing it through is
silently returning the wrong cached result);
STORE_UNAVAILABLE is an infrastructure failure — caller
decides fail-open (run anyway, lose dedup) or fail-closed
(refuse to risk a duplicate side-effect).-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCache hit underRetryBehavior.FAIL_FAST.The cached entry's input hash matches the current call's hash but the inputs are demonstrably different (e.g. tracked via a secondary fingerprint). -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.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
-
FAIL_FAST_HIT
Cache hit underRetryBehavior.FAIL_FAST. The original call's outcome is in the cache; the caller asked to be told about the duplicate rather than silently get the prior result. -
KEY_COLLISION_DIFFERENT_INPUT
The cached entry's input hash matches the current call's hash but the inputs are demonstrably different (e.g. tracked via a secondary fingerprint). Indicates a SHA-256 collision — vanishingly rare, but if it ever happens we want a hard error not a wrong cached return. -
STORE_UNAVAILABLE
TheIdempotencyStorethrew duringIdempotencyStore.get(java.lang.String)orIdempotencyStore.put(java.lang.String, com.tnsai.idempotency.IdempotencyEntry, java.time.Duration). Caller decides whether to fail-open (run the call without dedup) or fail-closed (refuse to risk a duplicate side-effect on a potentially-already-cached key).
-
-
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
-