Class WrappedTrackerStatus
java.lang.Object
org.axonframework.messaging.eventhandling.processing.streaming.segmenting.WrappedTrackerStatus
- All Implemented Interfaces:
EventTrackerStatus
- Direct Known Subclasses:
AddedTrackerStatus,RemovedTrackerStatus
Wrapper around an
EventTrackerStatus, delegating all calls to a delegate. Extend this class to
provide additional functionality to the delegate.- Since:
- 4.4
- Author:
- Steven van Beelen
-
Constructor Summary
ConstructorsConstructorDescriptionWrappedTrackerStatus(EventTrackerStatus delegate) Initializes theEventTrackerStatususing the givendelegate. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the estimated relative current token position this Segment represents.getError()Returns the exception that caused processing to fail, if present.Return the relative position at which a reset was triggered for this Segment.The segment for which this status is valid.The tracking token of the last event that has been seen by this Segment.inthashCode()booleanWhether the Segment of this status has caught up with the head of the event stream.booleanIndicates whether this status represents an error.booleanIndicates whether this Segment is still merging two (or more) Segments.booleanIndicates whether this Segment is still replaying previously processed Events.Return the estimated relative token position this Segment will have after a merge operation is complete.booleanReturns abooleandescribing whether thisEventTrackerStatusis starting it's progress for the first time.booleanReturns abooleandescribing whether thisEventTrackerStatushas just stopped it's progress.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.eventhandling.processing.streaming.segmenting.EventTrackerStatus
isDifferent, isDifferent, matchPositions, matchStates
-
Constructor Details
-
WrappedTrackerStatus
Initializes theEventTrackerStatususing the givendelegate.- Parameters:
delegate- the actualEventTrackerStatusto delegate to
-
-
Method Details
-
getSegment
Description copied from interface:EventTrackerStatusThe segment for which this status is valid.- Specified by:
getSegmentin interfaceEventTrackerStatus- Returns:
- segment for which this status is valid
-
isCaughtUp
public boolean isCaughtUp()Description copied from interface:EventTrackerStatusWhether the Segment of this status has caught up with the head of the event stream. Note that this is no guarantee that this segment is still processing at (or near) real-time events. It merely indicates that this segment has been at the head of the stream since it started processing. It may have fallen back since then.- Specified by:
isCaughtUpin interfaceEventTrackerStatus- Returns:
- whether the Segment of this status has caught up with the head of the event stream
-
isReplaying
public boolean isReplaying()Description copied from interface:EventTrackerStatusIndicates whether this Segment is still replaying previously processed Events.Note that this method will only recognize a replay if the tokens have been reset using
StreamingEventProcessor.resetTokens(). Removing tokens directly from the underlyingTokenStorewill not be recognized as a replay.- Specified by:
isReplayingin interfaceEventTrackerStatus- Returns:
trueif this segment is replaying historic events after areset, otherwisefalse
-
isMerging
public boolean isMerging()Description copied from interface:EventTrackerStatusIndicates whether this Segment is still merging two (or more) Segments. The merging process will be done once all Segments have reached the same position.- Specified by:
isMergingin interfaceEventTrackerStatus- Returns:
trueif this segment is merging Segments, otherwisefalse
-
mergeCompletedPosition
Description copied from interface:EventTrackerStatusReturn the estimated relative token position this Segment will have after a merge operation is complete. Will return a non-empty result as long asEventTrackerStatus.isMerging()} returns true. In case no estimation can be given or no merge in progress, anOptionalLong.empty()will be returned.- Specified by:
mergeCompletedPositionin interfaceEventTrackerStatus- Returns:
- return the estimated relative position this Segment will reach after a merge operation is complete.
-
getTrackingToken
Description copied from interface:EventTrackerStatusThe tracking token of the last event that has been seen by this Segment.The returned tracking token represents the position of this segment in the event stream. In case of a recent merge of segments, the token represents the lowest position of the two merged segments.
- Specified by:
getTrackingTokenin interfaceEventTrackerStatus- Returns:
- tracking token of the last event that has been seen by this Segment
-
isErrorState
public boolean isErrorState()Description copied from interface:EventTrackerStatusIndicates whether this status represents an error. When this method returntrue, theEventTrackerStatus.getError()will return the exception that caused the failure.- Specified by:
isErrorStatein interfaceEventTrackerStatus- Returns:
trueif an error was reported, otherwisefalse
-
getError
Description copied from interface:EventTrackerStatusReturns the exception that caused processing to fail, if present. If the segment is being processed normally, this method returnsnull.- Specified by:
getErrorin interfaceEventTrackerStatus- Returns:
- the exception that caused processing to fail, or
nullwhen processing normally
-
getCurrentPosition
Description copied from interface:EventTrackerStatusReturn the estimated relative current token position this Segment represents. In case of replay is active, return the estimated relative position reached by merge operation. In case of merge is active, return the estimated relative position reached by merge operation. In case no estimation can be given, or no replay or merge in progress, anOptionalLong.empty()will be returned.- Specified by:
getCurrentPositionin interfaceEventTrackerStatus- Returns:
- return the estimated relative current token position this Segment represents
-
getResetPosition
Description copied from interface:EventTrackerStatusReturn the relative position at which a reset was triggered for this Segment. In case a replay finished or no replay is active, anOptionalLong.empty()will be returned.- Specified by:
getResetPositionin interfaceEventTrackerStatus- Returns:
- the relative position at which a reset was triggered for this Segment
-
trackerAdded
public boolean trackerAdded()Description copied from interface:EventTrackerStatusReturns abooleandescribing whether thisEventTrackerStatusis starting it's progress for the first time. Particularly useful if theEventTrackerStatusChangeListenershould react to added status'.- Specified by:
trackerAddedin interfaceEventTrackerStatus- Returns:
trueif thisEventTrackerStatusjust started,falseotherwise
-
trackerRemoved
public boolean trackerRemoved()Description copied from interface:EventTrackerStatusReturns abooleandescribing whether thisEventTrackerStatushas just stopped it's progress. Particularly useful if theEventTrackerStatusChangeListenershould react to removed status'.- Specified by:
trackerRemovedin interfaceEventTrackerStatus- Returns:
trueif thisEventTrackerStatuswas just removed,falseotherwise
-
equals
-
hashCode
public int hashCode()
-