Record Class TransactionContextSummary
- Record Components:
contextId- transaction context identifierscope- transaction scope carried by the contextcorrelation- correlation and causal relationship metadatadeadline- effective deadline, orInstant.MAXwhen absentcancellationRequested- whether cancellation was requestedparticipant- safe participant identitymetadata- redacted metadata
- All Implemented Interfaces:
Serializable
The summary is not an ACID transaction handle. It is the preferred public status representation for transaction context because it exposes correlation, deadline, cancellation, participant, and redacted metadata needed for saga audit/status views without exposing command payloads or credential-like metadata. The record is immutable, thread-safe, and value based.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionContextSummary(TransactionContextId contextId, TransactionScope scope, TransactionCorrelation correlation, Instant deadline, boolean cancellationRequested, TransactionParticipant participant, Map<String, String> metadata) Creates a validated status-safe transaction context summary. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecancellationRequestedrecord component.Returns the value of thecontextIdrecord component.Returns the value of thecorrelationrecord component.deadline()Returns the value of thedeadlinerecord component.final booleanIndicates whether some other object is "equal to" this one.static TransactionContextSummaryfrom(TransactionContext context) Builds a redacted summary from a full execution context.final inthashCode()Returns a hash code value for this object.metadata()Returns the value of themetadatarecord component.Returns the value of theparticipantrecord component.scope()Returns the value of thescoperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TransactionContextSummary
public TransactionContextSummary(TransactionContextId contextId, TransactionScope scope, TransactionCorrelation correlation, Instant deadline, boolean cancellationRequested, TransactionParticipant participant, Map<String, String> metadata) Creates a validated status-safe transaction context summary.Missing values are replaced with safe defaults. Metadata is defensively copied and redacted, so the summary can be returned from service status, evidence, recovery reports, and demo output.
- Parameters:
contextId- transaction context identifierscope- transaction scopecorrelation- correlation metadatadeadline- deadline for the contextcancellationRequested- cancellation flagparticipant- safe participant identitymetadata- redacted metadata
-
-
Method Details
-
from
Builds a redacted summary from a full execution context.The returned value intentionally drops idempotency and dedupe objects that are not needed for public status. It preserves non-sensitive correlation, participant, deadline, and cancellation metadata.
- Parameters:
context- full internal transaction context- Returns:
- safe public summary
-
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. -
contextId
-
scope
-
correlation
Returns the value of thecorrelationrecord component.- Returns:
- the value of the
correlationrecord component
-
deadline
-
cancellationRequested
public boolean cancellationRequested()Returns the value of thecancellationRequestedrecord component.- Returns:
- the value of the
cancellationRequestedrecord component
-
participant
Returns the value of theparticipantrecord component.- Returns:
- the value of the
participantrecord component
-
metadata
-