Class AppendEventsTransactionRejectedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.axonframework.common.AxonException
org.axonframework.common.AxonNonTransientException
org.axonframework.eventsourcing.eventstore.AppendEventsTransactionRejectedException
- All Implemented Interfaces:
Serializable
Exception indicating that a transaction was rejected due to conflicts detected in the events to append.
- Since:
- 5.0.0
- Author:
- Steven van Beelen, Allard Buijze, John Hendrikx
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs anAppendEventsTransactionRejectedExceptionwith the givenmessage.AppendEventsTransactionRejectedException(String message, Set<Tag> tags) Constructs anAppendEventsTransactionRejectedExceptionwith the givenmessage, noting thetagsof thecriteriathat were violated. -
Method Summary
Modifier and TypeMethodDescriptionThe first event matching thecriteriafound beyond the violated consistency marker, if looked up; empty otherwise.conflictingEventsDetected(ConsistencyMarker consistencyMarker) Constructs anAppendEventsTransactionRejectedExceptionnoting that theEventStorageEnginecontains events matching thecriteriapassed the givenconsistencyMarker.conflictingEventsDetected(ConsistencyMarker consistencyMarker, Set<Tag> tags) Constructs anAppendEventsTransactionRejectedExceptionnoting that theEventStorageEnginecontains events matching thecriteriapassed the givenconsistencyMarker.tags()withConflictingEvent(@Nullable EventMessage conflictingEvent) Returns a copy ofthis AppendEventsTransactionRejectedExceptionwith itsconflictingEvent()replaced by the givenconflictingEvent, preserving the original message,tags(), stack trace, and cause.Methods inherited from class org.axonframework.common.AxonNonTransientException
isCauseOfMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
AppendEventsTransactionRejectedException
Constructs anAppendEventsTransactionRejectedExceptionwith the givenmessage.- Parameters:
message- the message of theAppendEventsTransactionRejectedExceptionunder construction
-
AppendEventsTransactionRejectedException
Constructs anAppendEventsTransactionRejectedExceptionwith the givenmessage, noting thetagsof thecriteriathat were violated.
-
-
Method Details
-
conflictingEventsDetected
public static AppendEventsTransactionRejectedException conflictingEventsDetected(ConsistencyMarker consistencyMarker) Constructs anAppendEventsTransactionRejectedExceptionnoting that theEventStorageEnginecontains events matching thecriteriapassed the givenconsistencyMarker.- Parameters:
consistencyMarker- the pointer in theEventStorageEngineafter which no events should've been appended that match theEventCriteriaof anAppendCondition- Returns:
- an
AppendEventsTransactionRejectedExceptionnoting that theEventStorageEnginecontains events matching thecriteriapassed the givenconsistencyMarker
-
conflictingEventsDetected
public static AppendEventsTransactionRejectedException conflictingEventsDetected(ConsistencyMarker consistencyMarker, Set<Tag> tags) Constructs anAppendEventsTransactionRejectedExceptionnoting that theEventStorageEnginecontains events matching thecriteriapassed the givenconsistencyMarker.- Parameters:
consistencyMarker- the pointer in theEventStorageEngineafter which no events should've been appended that match theEventCriteriaof anAppendConditiontags- theTagsof thecriteriathat were checked when the rejection occurred- Returns:
- an
AppendEventsTransactionRejectedExceptionnoting that theEventStorageEnginecontains events matching thecriteriapassed the givenconsistencyMarker
-
tags
-
conflictingEvent
The first event matching thecriteriafound beyond the violated consistency marker, if looked up; empty otherwise.- Returns:
- the first conflicting event, or empty if not looked up
-
withConflictingEvent
public AppendEventsTransactionRejectedException withConflictingEvent(@Nullable EventMessage conflictingEvent) Returns a copy ofthis AppendEventsTransactionRejectedExceptionwith itsconflictingEvent()replaced by the givenconflictingEvent, preserving the original message,tags(), stack trace, and cause.- Parameters:
conflictingEvent- an event that conflicted with thecriteria, ornullif none was found- Returns:
- a copy of
this AppendEventsTransactionRejectedExceptioncarrying the givenconflictingEvent
-