Class ClientH2PrefaceHandler
- java.lang.Object
-
- org.apache.hc.core5.http2.impl.nio.PrefaceHandlerBase
-
- org.apache.hc.core5.http2.impl.nio.ClientH2PrefaceHandler
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,HttpConnection,HttpConnectionEventHandler,SocketModalCloseable,ModalCloseable,IOEventHandler
@Internal public class ClientH2PrefaceHandler extends PrefaceHandlerBase
I/O event handler for events fired byProtocolIOSessionthat implements client side of the HTTP/2 protocol negotiation handshake always forcing the choice of HTTP/2.- Since:
- 5.2
-
-
Field Summary
Fields Modifier and Type Field Description private ClientH2StreamMultiplexerFactoryhttp2StreamHandlerFactoryprivate BufferedDatainBufprivate java.util.concurrent.atomic.AtomicBooleaninitializedprivate java.nio.ByteBufferpreface(package private) static byte[]PREFACEprivate booleanstrictALPNHandshake-
Fields inherited from class org.apache.hc.core5.http2.impl.nio.PrefaceHandlerBase
ioSession
-
-
Constructor Summary
Constructors Constructor Description ClientH2PrefaceHandler(ProtocolIOSession ioSession, ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, boolean strictALPNHandshake)ClientH2PrefaceHandler(ProtocolIOSession ioSession, ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, boolean strictALPNHandshake, FutureCallback<ProtocolIOSession> resultCallback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnected(IOSession session)Triggered after the given session has been just created.private voidinitialize()voidinputReady(IOSession session, java.nio.ByteBuffer src)Triggered when the given session has input pending.voidoutputReady(IOSession session)Triggered when the given session is ready for output.java.lang.StringtoString()private voidwriteOutPreface(IOSession session)-
Methods inherited from class org.apache.hc.core5.http2.impl.nio.PrefaceHandlerBase
close, close, disconnected, exception, getEndpointDetails, getLocalAddress, getProtocolVersion, getRemoteAddress, getSocketTimeout, getSSLSession, isOpen, setSocketTimeout, startProtocol, timeout
-
-
-
-
Field Detail
-
PREFACE
static final byte[] PREFACE
-
http2StreamHandlerFactory
private final ClientH2StreamMultiplexerFactory http2StreamHandlerFactory
-
strictALPNHandshake
private final boolean strictALPNHandshake
-
initialized
private final java.util.concurrent.atomic.AtomicBoolean initialized
-
preface
private volatile java.nio.ByteBuffer preface
-
inBuf
private volatile BufferedData inBuf
-
-
Constructor Detail
-
ClientH2PrefaceHandler
public ClientH2PrefaceHandler(ProtocolIOSession ioSession, ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, boolean strictALPNHandshake)
-
ClientH2PrefaceHandler
public ClientH2PrefaceHandler(ProtocolIOSession ioSession, ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, boolean strictALPNHandshake, FutureCallback<ProtocolIOSession> resultCallback)
- Since:
- 5.1
-
-
Method Detail
-
initialize
private void initialize() throws java.io.IOException- Throws:
java.io.IOException
-
writeOutPreface
private void writeOutPreface(IOSession session) throws java.io.IOException
- Throws:
java.io.IOException
-
connected
public void connected(IOSession session) throws java.io.IOException
Description copied from interface:IOEventHandlerTriggered after the given session has been just created.- Parameters:
session- the I/O session.- Throws:
java.io.IOException
-
outputReady
public void outputReady(IOSession session) throws java.io.IOException
Description copied from interface:IOEventHandlerTriggered when the given session is ready for output.- Parameters:
session- the I/O session.- Throws:
java.io.IOException
-
inputReady
public void inputReady(IOSession session, java.nio.ByteBuffer src) throws java.io.IOException
Description copied from interface:IOEventHandlerTriggered when the given session has input pending.- Parameters:
session- the I/O session.- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-