Top Description Fields Constructors Methods
org.apache.hc.core5.http2.impl.nio

public Class ClientH2PrefaceHandler

extends PrefaceHandlerBase
Class Inheritance
Annotations
@Internal
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.SelectionKey, java.util.concurrent.atomic.AtomicBoolean, org.apache.hc.core5.annotation.Internal, org.apache.hc.core5.concurrent.FutureCallback, org.apache.hc.core5.http.impl.nio.BufferedData, org.apache.hc.core5.http2.ssl.ApplicationProtocol, org.apache.hc.core5.reactor.IOSession, .ProtocolIOSession, org.apache.hc.core5.reactor.ssl.TlsDetails, org.apache.hc.core5.util.Args, .TextUtils

I/O event handler for events fired by ProtocolIOSession that implements client side of the HTTP/2 protocol negotiation handshake always forcing the choice of HTTP/2.
Since
5.2

Field Summary

Modifier and TypeField and Description
private final ClientH2StreamMultiplexerFactory
private volatile BufferedData
private final AtomicBoolean
pack-priv static final byte[]
private volatile ByteBuffer
private final boolean
Inherited from org.apache.hc.core5.http2.impl.nio.PrefaceHandlerBase:
ioSession

Constructor Summary

AccessConstructor and Description
public
ClientH2PrefaceHandler(final ProtocolIOSession ioSession, final ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, final boolean strictALPNHandshake)

public
ClientH2PrefaceHandler(final ProtocolIOSession ioSession, final ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, final boolean strictALPNHandshake, final FutureCallback<ProtocolIOSession> resultCallback)

Method Summary

Modifier and TypeMethod and Description
public void
connected(final IOSession
the I/O session.
session
)

Implements org.apache.hc.core5.reactor.IOEventHandler.connected.

Triggered after the given session has been just created.
private void
public void
inputReady(final IOSession
the I/O session.
session
,
final ByteBuffer src)

Implements org.apache.hc.core5.reactor.IOEventHandler.inputReady.

Triggered when the given session has input pending.
public void
outputReady(final IOSession
the I/O session.
session
)

Implements org.apache.hc.core5.reactor.IOEventHandler.outputReady.

Triggered when the given session is ready for output.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
private void
writeOutPreface(final IOSession session)

Inherited from org.apache.hc.core5.http2.impl.nio.PrefaceHandlerBase:
closeclosedisconnectedexceptiongetEndpointDetailsgetLocalAddressgetProtocolVersiongetRemoteAddressgetSocketTimeoutgetSSLSessionisOpensetSocketTimeoutstartProtocoltimeout

Field Detail

http2StreamHandlerFactoryback to summary
private final ClientH2StreamMultiplexerFactory http2StreamHandlerFactory
inBufback to summary
private volatile BufferedData inBuf
initializedback to summary
private final AtomicBoolean initialized
PREFACEback to summary
pack-priv static final byte[] PREFACE
prefaceback to summary
private volatile ByteBuffer preface
strictALPNHandshakeback to summary
private final boolean strictALPNHandshake

Constructor Detail

ClientH2PrefaceHandlerback to summary
public ClientH2PrefaceHandler(final ProtocolIOSession ioSession, final ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, final boolean strictALPNHandshake)
ClientH2PrefaceHandlerback to summary
public ClientH2PrefaceHandler(final ProtocolIOSession ioSession, final ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, final boolean strictALPNHandshake, final FutureCallback<ProtocolIOSession> resultCallback)
Since
5.1

Method Detail

connectedback to summary
public void connected(final IOSession session) throws IOException

Implements org.apache.hc.core5.reactor.IOEventHandler.connected.

Doc from org.apache.hc.core5.reactor.IOEventHandler.connected.

Triggered after the given session has been just created.

Parameters
session:IOSession

the I/O session.

Annotations
@Override
initializeback to summary
private void initialize() throws IOException
inputReadyback to summary
public void inputReady(final IOSession session, final ByteBuffer src) throws IOException

Implements org.apache.hc.core5.reactor.IOEventHandler.inputReady.

Doc from org.apache.hc.core5.reactor.IOEventHandler.inputReady.

Triggered when the given session has input pending.

Parameters
session:IOSession

the I/O session.

Annotations
@Override
outputReadyback to summary
public void outputReady(final IOSession session) throws IOException

Implements org.apache.hc.core5.reactor.IOEventHandler.outputReady.

Doc from org.apache.hc.core5.reactor.IOEventHandler.outputReady.

Triggered when the given session is ready for output.

Parameters
session:IOSession

the I/O session.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
writeOutPrefaceback to summary
private void writeOutPreface(final IOSession session) throws IOException