Package com.tnsai.hooks
Enum Class HookFailurePolicy
- All Implemented Interfaces:
Serializable,Comparable<HookFailurePolicy>,Constable
How the
HookDispatcher handles a hook that throws or times
out during apply (issue #58).
The choice is operator-driven: safety-critical deployments prefer
FAIL_CLOSED so a broken hook blocks rather than silently
allowing (the upstream invariant the hook enforces is too important
to quietly skip). Dev-mode and best-effort deployments prefer
FAIL_OPEN so a flaky hook doesn't take the system down.
- Since:
- 0.5.0 (issue #58)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTreat a failed hook asHookResult.Blockwith reason"hook-failure".Treat a failed hook asHookResult.Allowand continue the chain. -
Method Summary
Modifier and TypeMethodDescriptionstatic HookFailurePolicyReturns the enum constant of this class with the specified name.static HookFailurePolicy[]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_OPEN
Treat a failed hook asHookResult.Allowand continue the chain. Default for dev / best-effort deployments where availability matters more than every rule firing. -
FAIL_CLOSED
Treat a failed hook asHookResult.Blockwith reason"hook-failure". Default for safety-critical deployments where a broken rule must not let an operation through.
-
-
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
-