File tree Expand file tree Collapse file tree
src/main/java/io/github/easy4j/hermes/transport Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package io .github .easy4j .hermes .transport ;
2+
3+ /**
4+ * Classifies request behavior so transport recovery cannot accidentally replay side-effecting work.
5+ *
6+ * @since 1.0.0
7+ */
8+ public enum RequestSemantics {
9+ /** A read may be retried only by HTTP retry policy; it is not an SSE observation reattach. */
10+ READ (true , false ),
11+ /** Creating agent work must never be replayed merely because response observation failed. */
12+ AGENT_CREATE (false , false ),
13+ /** Side-effecting control writes require an explicit verified idempotency contract before replay. */
14+ CONTROL_WRITE (false , false ),
15+ /** Re-observing an already existing run may reconnect without creating new work. */
16+ OBSERVE (false , true );
17+
18+ private final boolean transportReplaySafe ;
19+ private final boolean observationReattachAllowed ;
20+
21+ RequestSemantics (boolean transportReplaySafe , boolean observationReattachAllowed ) {
22+ this .transportReplaySafe = transportReplaySafe ;
23+ this .observationReattachAllowed = observationReattachAllowed ;
24+ }
25+
26+ public boolean isTransportReplaySafe () {
27+ return transportReplaySafe ;
28+ }
29+
30+ public boolean isObservationReattachAllowed () {
31+ return observationReattachAllowed ;
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments