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 byProtocolIOSession
that 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 ClientH2StreamMultiplexerFactory
http2StreamHandlerFactory
private BufferedData
inBuf
private java.util.concurrent.atomic.AtomicBoolean
initialized
private java.nio.ByteBuffer
preface
(package private) static byte[]
PREFACE
private boolean
strictALPNHandshake
-
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 void
connected(IOSession session)
Triggered after the given session has been just created.private void
initialize()
void
inputReady(IOSession session, java.nio.ByteBuffer src)
Triggered when the given session has input pending.void
outputReady(IOSession session)
Triggered when the given session is ready for output.java.lang.String
toString()
private void
writeOutPreface(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:IOEventHandler
Triggered 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:IOEventHandler
Triggered 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:IOEventHandler
Triggered when the given session has input pending.- Parameters:
session
- the I/O session.- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-