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

pack-priv final Class Http2EmptyDataFrameListener

extends Http2FrameListenerDecorator
Class Inheritance
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelHandlerContext, io.netty.util.internal.ObjectUtil

Enforce a limit on the maximum number of consecutive empty DATA frames (without end_of_stream flag) that are allowed before the connection will be closed.

Field Summary

Modifier and TypeField and Description
private int
private final int
private boolean
Inherited from io.netty.handler.codec.http2.Http2FrameListenerDecorator:
listener

Constructor Summary

AccessConstructor and Description
pack-priv
Http2EmptyDataFrameListener(Http2FrameListener listener, int maxConsecutiveEmptyFrames)

Method Summary

Modifier and TypeMethod and Description
public int
onDataRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the subject stream for the frame.
streamId
,
ByteBuf
payload buffer for the frame. This buffer will be released by the codec.
data
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
,
boolean
Indicates whether this is the last frame to be sent from the remote endpoint for this stream.
endOfStream
)

Overrides io.netty.handler.codec.http2.Http2FrameListenerDecorator.onDataRead.

Implements io.netty.handler.codec.http2.Http2FrameListener.onDataRead.

Handles an inbound DATA frame.
public void
onHeadersRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the subject stream for the frame.
streamId
,
Http2Headers
the received headers.
headers
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
,
boolean
Indicates whether this is the last frame to be sent from the remote endpoint for this stream.
endStream
)

Overrides io.netty.handler.codec.http2.Http2FrameListenerDecorator.onHeadersRead.

Implements io.netty.handler.codec.http2.Http2FrameListener.onHeadersRead.

Handles an inbound HEADERS frame.
public void
onHeadersRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the subject stream for the frame.
streamId
,
Http2Headers
the received headers.
headers
,
int
the stream on which this stream depends, or 0 if dependent on the connection.
streamDependency
,
short
the new weight for the stream.
weight
,
boolean
whether or not the stream should be the exclusive dependent of its parent.
exclusive
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
,
boolean
Indicates whether this is the last frame to be sent from the remote endpoint for this stream.
endStream
)

Overrides io.netty.handler.codec.http2.Http2FrameListenerDecorator.onHeadersRead.

Implements io.netty.handler.codec.http2.Http2FrameListener.onHeadersRead.

Handles an inbound HEADERS frame with priority information specified.
Inherited from io.netty.handler.codec.http2.Http2FrameListenerDecorator:
onGoAwayReadonPingAckReadonPingReadonPriorityReadonPushPromiseReadonRstStreamReadonSettingsAckReadonSettingsReadonUnknownFrameonWindowUpdateRead

Field Detail

emptyDataFramesback to summary
private int emptyDataFrames
maxConsecutiveEmptyFramesback to summary
private final int maxConsecutiveEmptyFrames
violationDetectedback to summary
private boolean violationDetected

Constructor Detail

Http2EmptyDataFrameListenerback to summary
pack-priv Http2EmptyDataFrameListener(Http2FrameListener listener, int maxConsecutiveEmptyFrames)

Method Detail

onDataReadback to summary
public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) throws Http2Exception

Overrides io.netty.handler.codec.http2.Http2FrameListenerDecorator.onDataRead.

Implements io.netty.handler.codec.http2.Http2FrameListener.onDataRead.

Doc from io.netty.handler.codec.http2.Http2FrameListener.onDataRead.

Handles an inbound DATA frame.

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

streamId:int

the subject stream for the frame.

data:ByteBuf

payload buffer for the frame. This buffer will be released by the codec.

padding:int

additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).

endOfStream:boolean

Indicates whether this is the last frame to be sent from the remote endpoint for this stream.

Returns:int

the number of bytes that have been processed by the application. The returned bytes are used by the inbound flow controller to determine the appropriate time to expand the inbound flow control window (i.e. send WINDOW_UPDATE). Returning a value equal to the length of data + padding will effectively opt-out of application-level flow control for this frame. Returning a value less than the length of data + padding will defer the returning of the processed bytes, which the application must later return via Http2LocalFlowController#consumeBytes(Http2Stream, int). The returned value must be >= 0 and <= data.readableBytes() + padding.

Annotations
@Override
onHeadersReadback to summary
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream) throws Http2Exception

Overrides io.netty.handler.codec.http2.Http2FrameListenerDecorator.onHeadersRead.

Implements io.netty.handler.codec.http2.Http2FrameListener.onHeadersRead.

Doc from io.netty.handler.codec.http2.Http2FrameListener.onHeadersRead.

Handles an inbound HEADERS frame.

Only one of the following methods will be called for each HEADERS frame sequence. One will be called when the END_HEADERS flag has been received.

To say it another way; the Http2Headers will contain all of the headers for the current message exchange step (additional queuing is not necessary).

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

streamId:int

the subject stream for the frame.

headers:Http2Headers

the received headers.

padding:int

additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).

endStream:boolean

Indicates whether this is the last frame to be sent from the remote endpoint for this stream.

Annotations
@Override
onHeadersReadback to summary
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endStream) throws Http2Exception

Overrides io.netty.handler.codec.http2.Http2FrameListenerDecorator.onHeadersRead.

Implements io.netty.handler.codec.http2.Http2FrameListener.onHeadersRead.

Doc from io.netty.handler.codec.http2.Http2FrameListener.onHeadersRead.

Handles an inbound HEADERS frame with priority information specified. Only called if END_HEADERS encountered.

Only one of the following methods will be called for each HEADERS frame sequence. One will be called when the END_HEADERS flag has been received.

To say it another way; the Http2Headers will contain all of the headers for the current message exchange step (additional queuing is not necessary).

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

streamId:int

the subject stream for the frame.

headers:Http2Headers

the received headers.

streamDependency:int

the stream on which this stream depends, or 0 if dependent on the connection.

weight:short

the new weight for the stream.

exclusive:boolean

whether or not the stream should be the exclusive dependent of its parent.

padding:int

additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).

endStream:boolean

Indicates whether this is the last frame to be sent from the remote endpoint for this stream.

Annotations
@Override