Class ZenPing.PingCollection

  • Enclosing interface:
    ZenPing

    public static class ZenPing.PingCollection
    extends java.lang.Object
    a utility collection of pings where only the most recent ping is stored per node
    • Constructor Summary

      Constructors 
      Constructor Description
      PingCollection()  
    • Method Summary

      Modifier and Type Method Description
      boolean addPing​(ZenPing.PingResponse ping)
      adds a ping if newer than previous pings from the same node
      int size()
      the number of nodes for which there are known pings
      java.util.List<ZenPing.PingResponse> toList()
      serialize current pings to a list.
      • Methods inherited from class java.lang.Object

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

      • PingCollection

        public PingCollection()
    • Method Detail

      • addPing

        public boolean addPing​(ZenPing.PingResponse ping)
        adds a ping if newer than previous pings from the same node
        Returns:
        true if added, false o.w.
      • toList

        public java.util.List<ZenPing.PingResponse> toList()
        serialize current pings to a list. It is guaranteed that the list contains one ping response per node
      • size

        public int size()
        the number of nodes for which there are known pings