Class IdReplayTracker


  • public class IdReplayTracker
    extends java.lang.Object
    Class for monitoring incoming IDs and identifying replays.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long idlowerbound
      ID lower bound, no ID is valid at or below this value.
      protected int idtimeout
      Timeout for missing IDs.
      protected long idupperbound
      ID upper bound, the highest ID checked.
      protected java.util.Map<java.lang.Long,​java.lang.Long> missingIds
      IDs not checked yet between upper and lower bound.
      protected long nextidcleanup
      Timestamp for the next cleanup of the missing ID map.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean isReplay​(long id)
      Checks if an ID is a replay value, otherwise registers it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • idlowerbound

        protected long idlowerbound
        ID lower bound, no ID is valid at or below this value.
      • idupperbound

        protected long idupperbound
        ID upper bound, the highest ID checked.
      • nextidcleanup

        protected long nextidcleanup
        Timestamp for the next cleanup of the missing ID map.
      • idtimeout

        protected int idtimeout
        Timeout for missing IDs.
      • missingIds

        protected java.util.Map<java.lang.Long,​java.lang.Long> missingIds
        IDs not checked yet between upper and lower bound. Missing ID -> Timestamp of last packet.
    • Constructor Detail

      • IdReplayTracker

        public IdReplayTracker()
      • IdReplayTracker

        public IdReplayTracker​(long startid,
                               int idtimeout)
    • Method Detail

      • isReplay

        protected boolean isReplay​(long id)
        Checks if an ID is a replay value, otherwise registers it.
        Parameters:
        id - The ID.
        Returns:
        True, if the same ID was checked before, false otherwise.