PingHandlerImpl (3.14.0 310 API)
Date: 2018-05-30

com.marketfactory.zerogc.api

## Class PingHandlerImpl

- java.lang.Object
- - com.marketfactory.zerogc.api.PingHandlerImpl

- All Implemented Interfaces:
    PingHandler

      public final class PingHandlerImpl
      extends java.lang.Object
      implements PingHandler

  Companion class for the MFMarketMaker, MFClient classes Takes care of the ClientServer ping status The client will send a ping to the server periodically if needed. The ping has a monotonically increasing sequence number. The server responds with a ImHereMessage (pong message) that has the same sequence number the client sent in the ping message.

- - ### Field Summary

    - ### Fields inherited from interface com.marketfactory.zerogc.api.PingHandler

      `MAX_PING_TIME_COUNT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PingHandlerImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.marketfactory.zerogc.api.RuThereMessage` | `createPingMessageIfNeeded()`
    `void` | `disable()`
    `void` | `enable()`
    `java.util.List<PingTime>` | `getLastPingTimes()` Returns the newest `PingHandler.MAX_PING_TIME_COUNT` entries collected since the last call of this method.
    `void` | `resynchronize()`
    `void` | `updateWith(com.marketfactory.zerogc.api.ImHereMessage incomingPing)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PingHandlerImpl

          public PingHandlerImpl()

  - ### Method Detail

    - #### updateWith

          public void updateWith(com.marketfactory.zerogc.api.ImHereMessage incomingPing)

      Specified by:
        `updateWith` in interface `PingHandler`

    - #### disable

          public void disable()

      Specified by:
        `disable` in interface `PingHandler`

    - #### enable

          public void enable()

      Specified by:
        `enable` in interface `PingHandler`

    - #### createPingMessageIfNeeded

          public com.marketfactory.zerogc.api.RuThereMessage createPingMessageIfNeeded()

      Specified by:
        `createPingMessageIfNeeded` in interface `PingHandler`

    - #### resynchronize

          public void resynchronize()

      Specified by:
        `resynchronize` in interface `PingHandler`

    - #### getLastPingTimes

          public java.util.List<PingTime> getLastPingTimes()

      Description copied from interface: `PingHandler`
      Returns the newest `PingHandler.MAX_PING_TIME_COUNT` entries collected since the last call of this method. This method is zero-gc. The returned list and the contained PingTimes are reused. This means you cannot hold a reference to any of these objects.
      This call is thread-safe.
      The list of PingTimes will have the oldest value at index 0.
      The returned list is immutable.
      Specified by:
        `getLastPingTimes` in interface `PingHandler`
      Returns:
        received PingTime objects in order of oldest to most recent