Interface AppendCondition

All Superinterfaces:
EventsCondition

public sealed interface AppendCondition extends EventsCondition
Interface describing the consistency boundary condition for EventMessages when appending them to an Event Store.
Since:
5.0.0
Author:
Michal Negacz, Milan Savić, Marco Amann, Sara Pellegrini, Steven van Beelen, Allard Buijze
  • Method Details

    • none

      static AppendCondition none()
      Returns an AppendCondition that has no criteria nor consistency marker.

      Only use this AppendCondition when appending events that do not partake in the consistency boundary of any model(s).

      Returns:
      An AppendCondition that has no criteria nor consistency marker.
    • withCriteria

      static AppendCondition withCriteria(@Nonnull EventCriteria criteria)
      Creates an AppendCondition to append events only if no events matching given criteria are available.
      Parameters:
      criteria - The criteria for the AppendCondition.
      Returns:
      A condition that matches against given criteria.
    • orCriteria

      default AppendCondition orCriteria(@Nonnull EventCriteria criteria)
      Returns an AppendCondition with a condition that represents this AppendCondition's criteria or the given criteria.
      Parameters:
      criteria - The additional criteria the condition may match against.
      Returns:
      an AppendCondition that combined this condition's criteria and the given, using 'OR' semantics.
    • consistencyMarker

      ConsistencyMarker consistencyMarker()
      Returns the position in the event store until which the EventsCondition.criteria() should be validated against.

      Appending will fail when there are events appended after this point that match the provided EventCriteria.

      Returns:
      The position in the event store until which the EventsCondition.criteria() should be validated against.
    • withMarker

      AppendCondition withMarker(ConsistencyMarker consistencyMarker)
      Creates an AppendCondition with the same criteria as this one, but with given consistencyMarker.
      Parameters:
      consistencyMarker - The consistency marker for the new this AppendCondition.
      Returns:
      An AppendCondition with the given consistencyMarker.