Top Description Inners Fields Constructors Methods
io.netty.handler.codec.http2

public Class DefaultHttp2ConnectionDecoder

extends Object
implements Http2ConnectionDecoder
Class Inheritance
All Implemented Interfaces
io.netty.handler.codec.http2.Http2ConnectionDecoder, java.io.Closeable, java.lang.AutoCloseable
Annotations
@UnstableApi
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelHandlerContext, io.netty.handler.codec.http.HttpHeaderNames, .HttpStatusClass, .HttpUtil, io.netty.handler.codec.http2.Http2Connection.Endpoint, io.netty.util.internal.UnstableApi, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.util.Iterator, .List, .Map.Entry

Provides the default implementation for processing inbound frame events and delegates to a Http2FrameListener

This class will read HTTP/2 frames and delegate the events to a Http2FrameListener

This interface enforces inbound flow control functionality through Http2LocalFlowController

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private class
DefaultHttp2ConnectionDecoder.FrameReadListener

Handles all inbound frames from the network.

private class

Field Summary

Modifier and TypeField and Description
private final boolean
private final Http2Connection
private final Http2Connection.PropertyKey
private final Http2ConnectionEncoder
private final Http2FrameReader
private Http2FrameListener
private Http2LifecycleManager
private Http2FrameListener
private static final InternalLogger
private final Http2PromisedRequestVerifier
private final Http2SettingsReceivedConsumer
private final boolean

Constructor Summary

AccessConstructor and Description
public
public
public
DefaultHttp2ConnectionDecoder(Http2Connection
The Http2Connection associated with this decoder.
connection
,
Http2ConnectionEncoder
The Http2ConnectionEncoder associated with this decoder.
encoder
,
Http2FrameReader
Responsible for reading/parsing the raw frames. As opposed to this object which applies h2 semantics on top of the frames.
frameReader
,
Http2PromisedRequestVerifier
Determines if push promised streams are valid.
requestVerifier
,
boolean
false to disable automatically applying and sending settings acknowledge frame. The Http2ConnectionEncoder is expected to be an instance of Http2SettingsReceivedConsumer and will apply the earliest received but not yet ACKed SETTINGS when writing the SETTINGS ACKs. true to enable automatically applying and sending settings acknowledge frame.
autoAckSettings
)

Create a new instance.

public
DefaultHttp2ConnectionDecoder(Http2Connection connection, Http2ConnectionEncoder encoder, Http2FrameReader frameReader, Http2PromisedRequestVerifier requestVerifier, boolean autoAckSettings, boolean autoAckPing)

Deprecated
public
DefaultHttp2ConnectionDecoder(Http2Connection
The Http2Connection associated with this decoder.
connection
,
Http2ConnectionEncoder
The Http2ConnectionEncoder associated with this decoder.
encoder
,
Http2FrameReader
Responsible for reading/parsing the raw frames. As opposed to this object which applies h2 semantics on top of the frames.
frameReader
,
Http2PromisedRequestVerifier
Determines if push promised streams are valid.
requestVerifier
,
boolean
false to disable automatically applying and sending settings acknowledge frame. The Http2ConnectionEncoder is expected to be an instance of Http2SettingsReceivedConsumer and will apply the earliest received but not yet ACKed SETTINGS when writing the SETTINGS ACKs. true to enable automatically applying and sending settings acknowledge frame.
autoAckSettings
,
boolean
false to disable automatically sending ping acknowledge frame. true to enable automatically sending ping ack frame.
autoAckPing
,
boolean validateHeaders)

Create a new instance.

Method Summary

Modifier and TypeMethod and Description
protected long

Returns:

the threshold in bytes which should trigger a GO_AWAY if a set of headers exceeds this amount.
calculateMaxHeaderListSizeGoAway
(long
SETTINGS_MAX_HEADER_LIST_SIZE for the local endpoint.
maxHeaderListSize
)

Calculate the threshold in bytes which should trigger a GO_AWAY if a set of headers exceeds this amount.

public void
close()

Implements io.netty.handler.codec.http2.Http2ConnectionDecoder.close.

Closes this stream and releases any system resources associated with it.
public Http2Connection
connection()

Implements io.netty.handler.codec.http2.Http2ConnectionDecoder.connection.

Provides direct access to the underlying connection.
public void
decodeFrame(ChannelHandlerContext ctx, ByteBuf in, List<Object> out)

Implements io.netty.handler.codec.http2.Http2ConnectionDecoder.decodeFrame.

Called by the Http2ConnectionHandler to decode the next frame from the input buffer.
public final Http2LocalFlowController
flowController()

Implements io.netty.handler.codec.http2.Http2ConnectionDecoder.flowController.

Provides the local flow controller for managing inbound traffic.
public void
frameListener(Http2FrameListener listener)

Implements io.netty.handler.codec.http2.Http2ConnectionDecoder.frameListener.

Set the Http2FrameListener which will be notified when frames are decoded.
public Http2FrameListener
frameListener()

Implements io.netty.handler.codec.http2.Http2ConnectionDecoder.frameListener.

Get the Http2FrameListener which will be notified when frames are decoded.
public void
public Http2Settings
localSettings()

Implements io.netty.handler.codec.http2.Http2ConnectionDecoder.localSettings.

Gets the local settings for this endpoint of the HTTP/2 connection.
pack-priv void
onGoAwayRead0(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData)

pack-priv void
onUnknownFrame0(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload)

public boolean
prefaceReceived()

Implements io.netty.handler.codec.http2.Http2ConnectionDecoder.prefaceReceived.

Indicates whether or not the first initial SETTINGS frame was received from the remote endpoint.
private int
private void
verifyContentLength(Http2Stream stream, int data, boolean isEnd)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait