org.apache.hc.core5.http2.nio.support

## Class BasicPingHandler

- java.lang.Object
- - org.apache.hc.core5.http2.nio.support.BasicPingHandler

- All Implemented Interfaces:
    AsyncPingHandler

      public class BasicPingHandler
      extends Object
      implements AsyncPingHandler

  Basic `AsyncPingHandler` implementation.
  Since:
    5.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicPingHandler(Callback<Boolean> callback)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel()` Triggered to cancel the message exchange.
    `void` | `consumeResponse(ByteBuffer feedback)` Triggered to signal receipt of a ping response message.
    `void` | `failed(Exception cause)` Triggered to signal a failure in data processing.
    `ByteBuffer` | `getData()` Returns content of ping message.

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

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

- - ### Constructor Detail

    - #### BasicPingHandler

          public BasicPingHandler(Callback<Boolean> callback)

  - ### Method Detail

    - #### getData

          public ByteBuffer getData()

      Description copied from interface: `AsyncPingHandler`
      Returns content of ping message.
      Specified by:
        `getData` in interface `AsyncPingHandler`
      Returns:
        the ping message content.

    - #### consumeResponse

          public void consumeResponse(ByteBuffer feedback)
                               throws HttpException,
                                      IOException

      Description copied from interface: `AsyncPingHandler`
      Triggered to signal receipt of a ping response message.
      Specified by:
        `consumeResponse` in interface `AsyncPingHandler`
      Parameters:
        `feedback` - the ping message feedback.
      Throws:
        `HttpException`
        `IOException`

    - #### failed

          public void failed(Exception cause)

      Description copied from interface: `AsyncPingHandler`
      Triggered to signal a failure in data processing.
      Specified by:
        `failed` in interface `AsyncPingHandler`
      Parameters:
        `cause` - the cause of the failure.

    - #### cancel

          public void cancel()

      Description copied from interface: `AsyncPingHandler`
      Triggered to cancel the message exchange.
      Specified by:
        `cancel` in interface `AsyncPingHandler`

Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.