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, wait
isDifferent, isDifferent, matchPositions, matchStates
public WrappedTrackerStatus(EventTrackerStatus delegate)
EventTrackerStatus
using the given delegate
.delegate
- the actual EventTrackerStatus
to delegate topublic Segment getSegment()
EventTrackerStatus
getSegment
in interface EventTrackerStatus
public boolean isCaughtUp()
EventTrackerStatus
isCaughtUp
in interface EventTrackerStatus
public 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 EventTrackerStatus
true
if this segment is replaying historic events after a reset
, otherwise false
public boolean isMerging()
EventTrackerStatus
isMerging
in interface EventTrackerStatus
true
if this segment is merging Segments, otherwise false
public OptionalLong mergeCompletedPosition()
EventTrackerStatus
EventTrackerStatus.isMerging()
} returns true. In case no estimation
can be given or no merge in progress, an OptionalLong.empty()
will be returned.mergeCompletedPosition
in interface EventTrackerStatus
public TrackingToken getTrackingToken()
EventTrackerStatus
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.
getTrackingToken
in interface EventTrackerStatus
public boolean isErrorState()
EventTrackerStatus
true
, the EventTrackerStatus.getError()
will return the exception that caused the failure.isErrorState
in interface EventTrackerStatus
true
if an error was reported, otherwise false
public Throwable getError()
EventTrackerStatus
null
.getError
in interface EventTrackerStatus
null
when processing normallypublic OptionalLong getCurrentPosition()
EventTrackerStatus
OptionalLong.empty()
will be returned.getCurrentPosition
in interface EventTrackerStatus
public OptionalLong getResetPosition()
EventTrackerStatus
OptionalLong.empty()
will be returned.getResetPosition
in interface EventTrackerStatus
public boolean trackerAdded()
EventTrackerStatus
boolean
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 EventTrackerStatus
true
if this EventTrackerStatus
just started, false
otherwisepublic boolean trackerRemoved()
EventTrackerStatus
boolean
describing whether this EventTrackerStatus
has just stopped it's progress.
Particularly useful if the EventTrackerStatusChangeListener
should react to removed status'.trackerRemoved
in interface EventTrackerStatus
true
if this EventTrackerStatus
was just removed, false
otherwiseCopyright © 2010–2024. All rights reserved.