@UnstableApi public class DefaultHttp2ConnectionDecoder extends java.lang.Object implements Http2ConnectionDecoder
Http2FrameListener
This class will read HTTP/2 frames and delegate the events to a Http2FrameListener
This interface enforces inbound flow control functionality through
Http2LocalFlowController
Modifier and Type | Class and Description |
---|---|
private class |
DefaultHttp2ConnectionDecoder.FrameReadListener
Handles all inbound frames from the network.
|
private class |
DefaultHttp2ConnectionDecoder.PrefaceFrameListener |
Modifier and Type | Field and Description |
---|---|
private Http2Connection |
connection |
private Http2ConnectionEncoder |
encoder |
private Http2FrameReader |
frameReader |
private Http2FrameListener |
internalFrameListener |
private Http2LifecycleManager |
lifecycleManager |
private Http2FrameListener |
listener |
private static InternalLogger |
logger |
private Http2PromisedRequestVerifier |
requestVerifier |
Constructor and Description |
---|
DefaultHttp2ConnectionDecoder(Http2Connection connection,
Http2ConnectionEncoder encoder,
Http2FrameReader frameReader) |
DefaultHttp2ConnectionDecoder(Http2Connection connection,
Http2ConnectionEncoder encoder,
Http2FrameReader frameReader,
Http2PromisedRequestVerifier requestVerifier) |
Modifier and Type | Method and Description |
---|---|
protected long |
calculateMaxHeaderListSizeGoAway(long maxHeaderListSize)
Calculate the threshold in bytes which should trigger a
GO_AWAY if a set of headers exceeds this amount. |
void |
close() |
Http2Connection |
connection()
Provides direct access to the underlying connection.
|
void |
decodeFrame(ChannelHandlerContext ctx,
ByteBuf in,
java.util.List<java.lang.Object> out)
Called by the
Http2ConnectionHandler to decode the next frame from the input buffer. |
Http2LocalFlowController |
flowController()
Provides the local flow controller for managing inbound traffic.
|
Http2FrameListener |
frameListener()
Get the
Http2FrameListener which will be notified when frames are decoded. |
void |
frameListener(Http2FrameListener listener)
Set the
Http2FrameListener which will be notified when frames are decoded. |
(package private) Http2FrameListener |
internalFrameListener() |
void |
lifecycleManager(Http2LifecycleManager lifecycleManager)
Sets the lifecycle manager.
|
Http2Settings |
localSettings()
Gets the local settings for this endpoint of the HTTP/2 connection.
|
(package private) void |
onGoAwayRead0(ChannelHandlerContext ctx,
int lastStreamId,
long errorCode,
ByteBuf debugData) |
(package private) void |
onUnknownFrame0(ChannelHandlerContext ctx,
byte frameType,
int streamId,
Http2Flags flags,
ByteBuf payload) |
boolean |
prefaceReceived()
Indicates whether or not the first initial
SETTINGS frame was received from the remote endpoint. |
private int |
unconsumedBytes(Http2Stream stream) |
private static final InternalLogger logger
private Http2FrameListener internalFrameListener
private final Http2Connection connection
private Http2LifecycleManager lifecycleManager
private final Http2ConnectionEncoder encoder
private final Http2FrameReader frameReader
private Http2FrameListener listener
private final Http2PromisedRequestVerifier requestVerifier
public DefaultHttp2ConnectionDecoder(Http2Connection connection, Http2ConnectionEncoder encoder, Http2FrameReader frameReader)
public DefaultHttp2ConnectionDecoder(Http2Connection connection, Http2ConnectionEncoder encoder, Http2FrameReader frameReader, Http2PromisedRequestVerifier requestVerifier)
public void lifecycleManager(Http2LifecycleManager lifecycleManager)
Http2ConnectionDecoder
lifecycleManager
in interface Http2ConnectionDecoder
public Http2Connection connection()
Http2ConnectionDecoder
connection
in interface Http2ConnectionDecoder
public final Http2LocalFlowController flowController()
Http2ConnectionDecoder
flowController
in interface Http2ConnectionDecoder
public void frameListener(Http2FrameListener listener)
Http2ConnectionDecoder
Http2FrameListener
which will be notified when frames are decoded.
This must be set before frames are decoded.
frameListener
in interface Http2ConnectionDecoder
public Http2FrameListener frameListener()
Http2ConnectionDecoder
Http2FrameListener
which will be notified when frames are decoded.frameListener
in interface Http2ConnectionDecoder
Http2FrameListener internalFrameListener()
public boolean prefaceReceived()
Http2ConnectionDecoder
SETTINGS
frame was received from the remote endpoint.prefaceReceived
in interface Http2ConnectionDecoder
public void decodeFrame(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws Http2Exception
Http2ConnectionDecoder
Http2ConnectionHandler
to decode the next frame from the input buffer.decodeFrame
in interface Http2ConnectionDecoder
Http2Exception
public Http2Settings localSettings()
Http2ConnectionDecoder
localSettings
in interface Http2ConnectionDecoder
public void close()
close
in interface Http2ConnectionDecoder
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
protected long calculateMaxHeaderListSizeGoAway(long maxHeaderListSize)
GO_AWAY
if a set of headers exceeds this amount.maxHeaderListSize
- SETTINGS_MAX_HEADER_LIST_SIZE for the local
endpoint.GO_AWAY
if a set of headers exceeds this amount.private int unconsumedBytes(Http2Stream stream)
void onGoAwayRead0(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData) throws Http2Exception
Http2Exception
void onUnknownFrame0(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload) throws Http2Exception
Http2Exception