Interface StreamingCondition

All Superinterfaces:
EventsCondition

public sealed interface StreamingCondition extends EventsCondition
Interface describing the condition to
invalid reference
stream
from a streamable event source (like an Event Store).

This condition has a mandatory position() that dictates from what point streaming should commence. Additionally, an criteria() can be set to filter the stream of events.

Since:
5.0.0
Author:
Michal Negacz, Milan Savić, Marco Amann, Sara Pellegrini, Steven van Beelen
  • Method Details

    • startingFrom

      static StreamingCondition startingFrom(@Nullable TrackingToken position)
      Constructs a simple StreamingCondition that starts streaming from the given position. When the position is null streaming will start from the beginning of the Event Store.
      Parameters:
      position - The TrackingToken describing the position to start streaming from.
      Returns:
      A simple StreamingCondition that starts streaming from the given position.
    • conditionFor

      static StreamingCondition conditionFor(@Nonnull TrackingToken position, @Nonnull EventCriteria criteria)
      Constructs a simple StreamingCondition that starts streaming from the given position, only returning events matching the given criteria.
      Parameters:
      position - The TrackingToken describing the position to start streaming from.
      criteria - The criteria used to match events that are to be streamed.
      Returns:
      A simple StreamingCondition that starts streaming from the given position, only returning events matching the given criteria.
    • position

      TrackingToken position()
      The position as a TrackingToken to start streaming from.
      Returns:
      The position as a TrackingToken to start streaming from.
    • criteria

      default EventCriteria criteria()
      Description copied from interface: EventsCondition
      The set of criteria against which events must match.
      Specified by:
      criteria in interface EventsCondition
      Returns:
      The EventCriteria used to match this condition against.
    • or

      StreamingCondition or(@Nonnull EventCriteria criteria)
      Combines the criteria() of this StreamingCondition with the given criteria.
      Parameters:
      criteria - The EventCriteria to EventCriteria.or() with the criteria() of this StreamingCondition.
      Returns:
      A StreamingCondition that "or-ed" the given criteria with the criteria() of this StreamingCondition.