Record Class DeliverySemantics
java.lang.Object
java.lang.Record
org.j7m.middleware.api.reliability.DeliverySemantics
- Record Components:
mode- requested delivery moderetrySafe- whether retry is known to be safeeffectivelyOncePattern- whether effectively-once pattern metadata is present
- All Implemented Interfaces:
Serializable
public record DeliverySemantics(DeliveryMode mode, boolean retrySafe, boolean effectivelyOncePattern)
extends Record
implements Serializable
Delivery semantics selected for an invocation.
The record is immutable, serializable, and thread-safe. Generic exactly-once distributed execution is represented as unsupported and must be rejected by evaluators.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeliverySemantics(DeliveryMode mode, boolean retrySafe, boolean effectivelyOncePattern) Creates validated delivery semantics. -
Method Summary
Modifier and TypeMethodDescriptionstatic DeliverySemanticsReturns at-least-once retryable semantics.static DeliverySemanticsReturns at-most-once best-effort semantics.booleanReturns the value of theeffectivelyOncePatternrecord component.static DeliverySemanticsReturns effectively-once pattern metadata semantics.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.mode()Returns the value of themoderecord component.booleanReturns the value of theretrySaferecord component.final StringtoString()Returns a string representation of this record class.static DeliverySemanticsReturns an unsupported generic exactly-once request.booleanReports whether the request is a generic exactly-once claim.
-
Constructor Details
-
DeliverySemantics
Creates validated delivery semantics.
-
-
Method Details
-
atMostOnceBestEffort
Returns at-most-once best-effort semantics.- Returns:
- semantics
-
atLeastOnceRetryable
Returns at-least-once retryable semantics.- Returns:
- semantics
-
effectivelyOncePatternSupport
Returns effectively-once pattern metadata semantics.- Returns:
- semantics
-
unsupportedExactlyOnce
Returns an unsupported generic exactly-once request.- Returns:
- semantics
-
unsupportedExactlyOnceRequested
public boolean unsupportedExactlyOnceRequested()Reports whether the request is a generic exactly-once claim.- Returns:
truewhen unsupported exactly-once was requested
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
mode
-
retrySafe
-
effectivelyOncePattern
public boolean effectivelyOncePattern()Returns the value of theeffectivelyOncePatternrecord component.- Returns:
- the value of the
effectivelyOncePatternrecord component
-