public abstract class WrappedTrackerStatus extends Object implements EventTrackerStatus
EventTrackerStatus, delegating all calls to a delegate. Extend this class to
provide additional functionality to the delegate.| Constructor and Description |
|---|
WrappedTrackerStatus(EventTrackerStatus delegate)
Initializes the
EventTrackerStatus using the given delegate. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
OptionalLong |
getCurrentPosition()
Return the estimated relative current token position this Segment represents.
|
Throwable |
getError()
Returns the exception that caused processing to fail, if present.
|
OptionalLong |
getResetPosition()
Return the relative position at which a reset was triggered for this Segment.
|
Segment |
getSegment()
The segment for which this status is valid.
|
TrackingToken |
getTrackingToken()
The tracking token of the last event that has been seen by this Segment.
|
int |
hashCode() |
boolean |
isCaughtUp()
Whether the Segment of this status has caught up with the head of the event stream.
|
boolean |
isErrorState()
Indicates whether this status represents an error.
|
boolean |
isMerging()
Indicates whether this Segment is still merging two (or more) Segments.
|
boolean |
isReplaying()
Indicates whether this Segment is still replaying previously processed Events.
|
OptionalLong |
mergeCompletedPosition()
Return the estimated relative token position this Segment will have after a merge operation is complete.
|
boolean |
trackerAdded()
Returns a
boolean describing whether this EventTrackerStatus is starting it's progress for the
first time. |
boolean |
trackerRemoved()
Returns a
boolean describing whether this EventTrackerStatus has just stopped it's progress. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisDifferent, isDifferent, matchPositions, matchStatespublic WrappedTrackerStatus(EventTrackerStatus delegate)
EventTrackerStatus using the given delegate.delegate - the actual EventTrackerStatus to delegate topublic Segment getSegment()
EventTrackerStatusgetSegment in interface EventTrackerStatuspublic boolean isCaughtUp()
EventTrackerStatusisCaughtUp in interface EventTrackerStatuspublic boolean isReplaying()
EventTrackerStatus
Note that this method will only recognize a replay if the tokens have been reset using TrackingEventProcessor.resetTokens(). Removing tokens directly from the underlying TokenStore will not
be recognized as a replay.
isReplaying in interface EventTrackerStatustrue if this segment is replaying historic events after a reset, otherwise falsepublic boolean isMerging()
EventTrackerStatusisMerging in interface EventTrackerStatustrue if this segment is merging Segments, otherwise falsepublic OptionalLong mergeCompletedPosition()
EventTrackerStatusEventTrackerStatus.isMerging() } returns true. In case no estimation
can be given or no merge in progress, an OptionalLong.empty() will be returned.mergeCompletedPosition in interface EventTrackerStatuspublic TrackingToken getTrackingToken()
EventTrackerStatusThe 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.
getTrackingToken in interface EventTrackerStatuspublic boolean isErrorState()
EventTrackerStatustrue, the EventTrackerStatus.getError()
will return the exception that caused the failure.isErrorState in interface EventTrackerStatustrue if an error was reported, otherwise falsepublic Throwable getError()
EventTrackerStatusnull.getError in interface EventTrackerStatusnull when processing normallypublic OptionalLong getCurrentPosition()
EventTrackerStatusOptionalLong.empty() will be returned.getCurrentPosition in interface EventTrackerStatuspublic OptionalLong getResetPosition()
EventTrackerStatusOptionalLong.empty() will be returned.getResetPosition in interface EventTrackerStatuspublic boolean trackerAdded()
EventTrackerStatusboolean describing whether this EventTrackerStatus is starting it's progress for the
first time. Particularly useful if the EventTrackerStatusChangeListener should react to added status'.trackerAdded in interface EventTrackerStatustrue if this EventTrackerStatus just started, false otherwisepublic boolean trackerRemoved()
EventTrackerStatusboolean describing whether this EventTrackerStatus has just stopped it's progress.
Particularly useful if the EventTrackerStatusChangeListener should react to removed status'.trackerRemoved in interface EventTrackerStatustrue if this EventTrackerStatus was just removed, false otherwiseCopyright © 2010–2023. All rights reserved.