Interface SourcingCondition
- All Superinterfaces:
EventsCondition
Interface describing the condition to
source events from an
Event Store.
The condition has a mandatory EventsCondition.criteria() used to retrieve the exact sequence of events to source the
model(s). The start() operation defines the start point when sourcing events that the
EventStoreTransaction is interested in.
- Since:
- 5.0.0
- Author:
- Michal Negacz, Milan Savić, Marco Amann, Sara Pellegrini, Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptionstatic SourcingConditionconditionFor(Position start, EventCriteria criteria) Construct aSourcingConditionused to source a model based on the givencriteria.static SourcingConditionconditionFor(EventCriteria criteria) Construct aSourcingConditionused to source a model based on the givencriteria.or(SourcingCondition other) Mergesthis SourcingConditionwith the givenother SourcingCondition, by combining theirsearch criteriaandstarting points.default Positionstart()The start position in the event sequence to source.Methods inherited from interface org.axonframework.messaging.eventstreaming.EventsCondition
criteria, matches
-
Method Details
-
conditionFor
Construct aSourcingConditionused to source a model based on the givencriteria.- Parameters:
criteria- TheEventCriteriaused as theEventsCondition.criteria().- Returns:
- A
SourcingConditionthat will retrieve an event sequence matching the givencriteria.
-
conditionFor
Construct aSourcingConditionused to source a model based on the givencriteria.Will start the sequence at the given
startvalue.- Parameters:
start- The start position in the event sequence to retrieve of the model to source.criteria- TheEventCriteriaused as theEventsCondition.criteria().- Returns:
- A
SourcingConditionthat will retrieve an event sequence matching the givencriteria, starting at the givenstart.
-
start
The start position in the event sequence to source. Defaults to-1Lto ensure we start at the beginning of the sequence's stream complying to theEventsCondition.criteria().- Returns:
- The start position in the event sequence to source, never
null.
-
or
Mergesthis SourcingConditionwith the givenother SourcingCondition, by combining theirsearch criteriaandstarting points.Warning: If the starting points don't overlap or connect properly, the merged condition might return some events that neither of the original conditions would have returned on their own.
Usually, the earlier starting point (minimum start value) will be used in the final merged condition.
- Parameters:
other- TheSourcingConditionto combine withthis SourcingCondition.- Returns:
- A combined
SourcingConditionbased onthis SourcingConditionand the givenother.
-