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
BasicAsyncPingHandler
implementation.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private Callback<java.lang.Boolean>
callback
private 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 void
cancel()
Triggered to cancel the message exchange.void
consumeResponse(java.nio.ByteBuffer feedback)
Triggered to signal receipt of a ping response message.void
failed(java.lang.Exception cause)
Triggered to signal a failure in data processing.java.nio.ByteBuffer
getData()
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:AsyncPingHandler
Returns content of ping message.- Specified by:
getData
in interfaceAsyncPingHandler
- Returns:
- the ping message content.
-
consumeResponse
public void consumeResponse(java.nio.ByteBuffer feedback) throws HttpException, java.io.IOException
Description copied from interface:AsyncPingHandler
Triggered to signal receipt of a ping response message.- Specified by:
consumeResponse
in interfaceAsyncPingHandler
- Parameters:
feedback
- the ping message feedback.- Throws:
HttpException
java.io.IOException
-
failed
public void failed(java.lang.Exception cause)
Description copied from interface:AsyncPingHandler
Triggered to signal a failure in data processing.- Specified by:
failed
in interfaceAsyncPingHandler
- 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 interfaceAsyncPingHandler
-
-