Class AppendEventsTransactionRejectedException

All Implemented Interfaces:
Serializable

public class AppendEventsTransactionRejectedException extends AxonNonTransientException
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 Details

    • AppendEventsTransactionRejectedException

      public AppendEventsTransactionRejectedException(String message)
      Constructs an AppendEventsTransactionRejectedException with the given message.
      Parameters:
      message - the message of the AppendEventsTransactionRejectedException under construction
    • AppendEventsTransactionRejectedException

      public AppendEventsTransactionRejectedException(String message, Set<Tag> tags)
      Constructs an AppendEventsTransactionRejectedException with the given message, noting the tags of the criteria that were violated.
      Parameters:
      message - the message of the AppendEventsTransactionRejectedException under construction
      tags - the Tags of the criteria that were checked when the rejection occurred
  • Method Details

    • conflictingEventsDetected

      public static AppendEventsTransactionRejectedException conflictingEventsDetected(ConsistencyMarker consistencyMarker)
      Constructs an AppendEventsTransactionRejectedException noting that the EventStorageEngine contains events matching the criteria passed the given consistencyMarker.
      Parameters:
      consistencyMarker - the pointer in the EventStorageEngine after which no events should've been appended that match the EventCriteria of an AppendCondition
      Returns:
      an AppendEventsTransactionRejectedException noting that the EventStorageEngine contains events matching the criteria passed the given consistencyMarker
    • conflictingEventsDetected

      public static AppendEventsTransactionRejectedException conflictingEventsDetected(ConsistencyMarker consistencyMarker, Set<Tag> tags)
      Constructs an AppendEventsTransactionRejectedException noting that the EventStorageEngine contains events matching the criteria passed the given consistencyMarker.
      Parameters:
      consistencyMarker - the pointer in the EventStorageEngine after which no events should've been appended that match the EventCriteria of an AppendCondition
      tags - the Tags of the criteria that were checked when the rejection occurred
      Returns:
      an AppendEventsTransactionRejectedException noting that the EventStorageEngine contains events matching the criteria passed the given consistencyMarker
    • tags

      public Set<Tag> tags()
      The Tags of the criteria that were checked when this rejection occurred.
      Returns:
      the Tags of the criteria that were checked when this rejection occurred, or an empty Set if unknown
    • conflictingEvent

      public Optional<EventMessage> conflictingEvent()
      The first event matching the criteria found 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 of this AppendEventsTransactionRejectedException with its conflictingEvent() replaced by the given conflictingEvent, preserving the original message, tags(), stack trace, and cause.
      Parameters:
      conflictingEvent - an event that conflicted with the criteria, or null if none was found
      Returns:
      a copy of this AppendEventsTransactionRejectedException carrying the given conflictingEvent