Interface SourcingCondition
- All Superinterfaces:
EventsCondition
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 position, EventCriteria criteria) Construct aSourcingConditionused to source a model based on the givencriteria.static SourcingConditionconditionFor(SourcingStrategy sourcingStrategy, EventCriteria criteria) Construct aSourcingConditionused to source a model based on the givencriteriaandsourcing strategy.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 criteriaandsourcing strategies.default Positionstart()Deprecated, for removal: This API element is subject to removal in a future version.default SourcingStrategystrategy()The sourcing strategy used for this sourcing condition.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 - Throws:
NullPointerException- if any argument isnull
-
conditionFor
Construct aSourcingConditionused to source a model based on the givencriteria.Will start the sequence at the given absolute
positionvalue using theabsolute sourcing strategy.- Parameters:
position- the position to use for theabsolute sourcing strategycriteria- theEventCriteriaused as theEventsCondition.criteria()- Returns:
- a
SourcingConditionthat will retrieve an event sequence matching the givencriteria, starting at the givenposition - Throws:
NullPointerException- if any argument isnull
-
conditionFor
Construct aSourcingConditionused to source a model based on the givencriteriaandsourcing strategy.- Parameters:
sourcingStrategy- theSourcingStrategyused to construct the message streamcriteria- theEventCriteriaused as theEventsCondition.criteria()- Returns:
- a
SourcingConditionthat will retrieve an event sequence matching the givencriteria, according to the givensourcingStrategy - Throws:
NullPointerException- if any argument isnull
-
start
Deprecated, for removal: This API element is subject to removal in a future version.usestrategy()'s and check for theabsolute modeThe start position in the event sequence to source. Defaults toPosition.STARTto 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
-
strategy
The sourcing strategy used for this sourcing condition.- Returns:
- a
SourcingStrategy, nevernull
-
or
Mergesthis SourcingConditionwith the givenother SourcingCondition, by combining theirsearch criteriaandsourcing strategies.Warning: if the sourcing strategies cannot be combined, this method will fail with an
UnsupportedOperationException. If both sourcing strategies useabsolute positioning, then the merged condition might return some events that neither of the original conditions would have returned on their own.For positional strategies, 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 - Throws:
NullPointerException- if any argument isnullUnsupportedOperationException- if the strategies are uncombinable
-
strategy()'s and check for theabsolute mode