Class BasicPingHandler
- java.lang.Object
-
- org.apache.hc.core5.http2.nio.support.BasicPingHandler
-
- All Implemented Interfaces:
AsyncPingHandler
public class BasicPingHandler extends java.lang.Object implements AsyncPingHandler
BasicAsyncPingHandlerimplementation.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private Callback<java.lang.Boolean>callbackprivate static byte[]PING_MESSAGE
-
Constructor Summary
Constructors Constructor Description BasicPingHandler(Callback<java.lang.Boolean> callback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Triggered to cancel the message exchange.voidconsumeResponse(java.nio.ByteBuffer feedback)Triggered to signal receipt of a ping response message.voidfailed(java.lang.Exception cause)Triggered to signal a failure in data processing.java.nio.ByteBuffergetData()Returns content of ping message.
-
-
-
Field Detail
-
PING_MESSAGE
private static final byte[] PING_MESSAGE
-
callback
private final Callback<java.lang.Boolean> callback
-
-
Constructor Detail
-
BasicPingHandler
public BasicPingHandler(Callback<java.lang.Boolean> callback)
-
-
Method Detail
-
getData
public java.nio.ByteBuffer getData()
Description copied from interface:AsyncPingHandlerReturns content of ping message.- Specified by:
getDatain interfaceAsyncPingHandler- Returns:
- the ping message content.
-
consumeResponse
public void consumeResponse(java.nio.ByteBuffer feedback) throws HttpException, java.io.IOExceptionDescription copied from interface:AsyncPingHandlerTriggered to signal receipt of a ping response message.- Specified by:
consumeResponsein interfaceAsyncPingHandler- Parameters:
feedback- the ping message feedback.- Throws:
HttpExceptionjava.io.IOException
-
failed
public void failed(java.lang.Exception cause)
Description copied from interface:AsyncPingHandlerTriggered to signal a failure in data processing.- Specified by:
failedin interfaceAsyncPingHandler- Parameters:
cause- the cause of the failure.
-
cancel
public void cancel()
Description copied from interface:AsyncPingHandlerTriggered to cancel the message exchange.- Specified by:
cancelin interfaceAsyncPingHandler
-
-