Class AbstractConsistencyMarker<T extends ConsistencyMarker>
java.lang.Object
org.axonframework.eventsourcing.eventstore.AbstractConsistencyMarker<T>
- Type Parameters:
T- The type of ConsistencyMarker this implementation expects. It's typically the same as the implementing class.
- All Implemented Interfaces:
ConsistencyMarker
- Direct Known Subclasses:
AggregateBasedConsistencyMarker,GlobalIndexConsistencyMarker
public abstract class AbstractConsistencyMarker<T extends ConsistencyMarker>
extends Object
implements ConsistencyMarker
Abstract implementation of the
ConsistencyMarker interface that implements the required comparisons with the
ConsistencyMarker.ORIGIN and
ConsistencyMarker.INFINITY consistency markers. The
implementation-specific comparisons are left to the subclasses.- Since:
- 5.0.0
- Author:
- Allard Buijze
-
Field Summary
Fields inherited from interface org.axonframework.eventsourcing.eventstore.ConsistencyMarker
INFINITY, ORIGIN, RESOURCE_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ConsistencyMarkerdoLowerBound(T other) Calculate the lower bound ofthismarker and givenothermarker.protected abstract ConsistencyMarkerdoUpperBound(T other) Calculate the upper bound ofthismarker and givenothermarker.lowerBound(ConsistencyMarker other) Returns a ConsistencyMarker that represents the lower bound ofthisand givenothermarkers.upperBound(ConsistencyMarker other) Returns a ConsistencyMarker that represents the upper bound ofthisand givenothermarkers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.eventsourcing.eventstore.ConsistencyMarker
position
-
Constructor Details
-
AbstractConsistencyMarker
public AbstractConsistencyMarker()
-
-
Method Details
-
lowerBound
Description copied from interface:ConsistencyMarkerReturns a ConsistencyMarker that represents the lower bound ofthisand givenothermarkers. Effectively, this means that any events whose position in the event stream is beyond eitherthisor theothermarker, will also be beyond the returned marker.- Specified by:
lowerBoundin interfaceConsistencyMarker- Parameters:
other- The other marker to create the lower bound for- Returns:
- a ConsistencyMarker that represents the lower bound of two other markers
- Throws:
ClassCastException- when the given marker is not of the expected type.
-
upperBound
Description copied from interface:ConsistencyMarkerReturns a ConsistencyMarker that represents the upper bound ofthisand givenothermarkers. Effectively, this means that only events whose position in the event stream is beyond boththisand theothermarker, will also be beyond the returned marker.- Specified by:
upperBoundin interfaceConsistencyMarker- Parameters:
other- The other marker to create the upper bound for- Returns:
- a ConsistencyMarker that represents the upper bound of two other markers
- Throws:
ClassCastException- when the given marker is not of the expected type
-
doLowerBound
Calculate the lower bound ofthismarker and givenothermarker. The result must represent the lowest of the given markers. This may either be on ofthisor theothermarker, or any other that represents their lower bound.- Parameters:
other- The other marker.- Returns:
- A marker representing the lower bound of this and the other marker.
-
doUpperBound
Calculate the upper bound ofthismarker and givenothermarker. The result must represent the highest of the given markers. This may either be on ofthisor theothermarker, or any other that represents their upper bound.- Parameters:
other- The other marker.- Returns:
- A marker representing the upper bound of this and the other marker.
-