java.lang.Object
org.axonframework.messaging.eventhandling.processing.streaming.segmenting.WrappedTrackerStatus
All Implemented Interfaces:
EventTrackerStatus
Direct Known Subclasses:
AddedTrackerStatus, RemovedTrackerStatus

public abstract class WrappedTrackerStatus extends Object implements EventTrackerStatus
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 Details

  • Method Details

    • getSegment

      public Segment getSegment()
      Description copied from interface: EventTrackerStatus
      The segment for which this status is valid.
      Specified by:
      getSegment in interface EventTrackerStatus
      Returns:
      segment for which this status is valid
    • isCaughtUp

      public boolean isCaughtUp()
      Description copied from interface: EventTrackerStatus
      Whether 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:
      isCaughtUp in interface EventTrackerStatus
      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: EventTrackerStatus
      Indicates 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 underlying TokenStore will not be recognized as a replay.

      Specified by:
      isReplaying in interface EventTrackerStatus
      Returns:
      true if this segment is replaying historic events after a reset, otherwise false
    • isMerging

      public boolean isMerging()
      Description copied from interface: EventTrackerStatus
      Indicates 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:
      isMerging in interface EventTrackerStatus
      Returns:
      true if this segment is merging Segments, otherwise false
    • mergeCompletedPosition

      public OptionalLong mergeCompletedPosition()
      Description copied from interface: EventTrackerStatus
      Return the estimated relative token position this Segment will have after a merge operation is complete. Will return a non-empty result as long as EventTrackerStatus.isMerging() } returns true. In case no estimation can be given or no merge in progress, an OptionalLong.empty() will be returned.
      Specified by:
      mergeCompletedPosition in interface EventTrackerStatus
      Returns:
      return the estimated relative position this Segment will reach after a merge operation is complete.
    • getTrackingToken

      public TrackingToken getTrackingToken()
      Description copied from interface: EventTrackerStatus
      The 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:
      getTrackingToken in interface EventTrackerStatus
      Returns:
      tracking token of the last event that has been seen by this Segment
    • isErrorState

      public boolean isErrorState()
      Description copied from interface: EventTrackerStatus
      Indicates whether this status represents an error. When this method return true, the EventTrackerStatus.getError() will return the exception that caused the failure.
      Specified by:
      isErrorState in interface EventTrackerStatus
      Returns:
      true if an error was reported, otherwise false
    • getError

      public Throwable getError()
      Description copied from interface: EventTrackerStatus
      Returns the exception that caused processing to fail, if present. If the segment is being processed normally, this method returns null.
      Specified by:
      getError in interface EventTrackerStatus
      Returns:
      the exception that caused processing to fail, or null when processing normally
    • getCurrentPosition

      public OptionalLong getCurrentPosition()
      Description copied from interface: EventTrackerStatus
      Return 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, an OptionalLong.empty() will be returned.
      Specified by:
      getCurrentPosition in interface EventTrackerStatus
      Returns:
      return the estimated relative current token position this Segment represents
    • getResetPosition

      public OptionalLong getResetPosition()
      Description copied from interface: EventTrackerStatus
      Return the relative position at which a reset was triggered for this Segment. In case a replay finished or no replay is active, an OptionalLong.empty() will be returned.
      Specified by:
      getResetPosition in interface EventTrackerStatus
      Returns:
      the relative position at which a reset was triggered for this Segment
    • trackerAdded

      public boolean trackerAdded()
      Description copied from interface: EventTrackerStatus
      Returns a boolean describing whether this EventTrackerStatus is starting it's progress for the first time. Particularly useful if the EventTrackerStatusChangeListener should react to added status'.
      Specified by:
      trackerAdded in interface EventTrackerStatus
      Returns:
      true if this EventTrackerStatus just started, false otherwise
    • trackerRemoved

      public boolean trackerRemoved()
      Description copied from interface: EventTrackerStatus
      Returns a boolean describing whether this EventTrackerStatus has just stopped it's progress. Particularly useful if the EventTrackerStatusChangeListener should react to removed status'.
      Specified by:
      trackerRemoved in interface EventTrackerStatus
      Returns:
      true if this EventTrackerStatus was just removed, false otherwise
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object