private static final class Http2FrameCodec.FrameListener extends Http2FrameAdapter
Modifier | Constructor and Description |
---|---|
private |
FrameListener() |
Modifier and Type | Method and Description |
---|---|
int |
onDataRead(ChannelHandlerContext ctx,
int streamId,
ByteBuf data,
int padding,
boolean endOfStream)
Handles an inbound
DATA frame. |
void |
onHeadersRead(ChannelHandlerContext ctx,
int streamId,
Http2Headers headers,
int padding,
boolean endOfStream)
Handles an inbound
HEADERS frame. |
void |
onHeadersRead(ChannelHandlerContext ctx,
int streamId,
Http2Headers headers,
int streamDependency,
short weight,
boolean exclusive,
int padding,
boolean endStream)
Handles an inbound
HEADERS frame with priority information specified. |
void |
onRstStreamRead(ChannelHandlerContext ctx,
int streamId,
long errorCode)
Handles an inbound
RST_STREAM frame. |
onGoAwayRead, onPingAckRead, onPingRead, onPriorityRead, onPushPromiseRead, onSettingsAckRead, onSettingsRead, onUnknownFrame, onWindowUpdateRead
public void onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode)
Http2FrameListener
RST_STREAM
frame.onRstStreamRead
in interface Http2FrameListener
onRstStreamRead
in class Http2FrameAdapter
ctx
- the context from the handler where the frame was read.streamId
- the stream that is terminating.errorCode
- the error code identifying the type of failure.public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endStream)
Http2FrameListener
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.
Http2FrameListener.onHeadersRead(ChannelHandlerContext, int, Http2Headers, int, boolean)
Http2FrameListener.onHeadersRead(ChannelHandlerContext, int, Http2Headers, int, short, boolean, int, boolean)
Http2FrameListener.onPushPromiseRead(ChannelHandlerContext, int, int, Http2Headers, int)
To say it another way; the Http2Headers
will contain all of the headers
for the current message exchange step (additional queuing is not necessary).
onHeadersRead
in interface Http2FrameListener
onHeadersRead
in class Http2FrameAdapter
ctx
- the context from the handler where the frame was read.streamId
- the subject stream for the frame.headers
- the received headers.streamDependency
- the stream on which this stream depends, or 0 if dependent on the
connection.weight
- the new weight for the stream.exclusive
- whether or not the stream should be the exclusive dependent of its parent.padding
- additional bytes that should be added to obscure the true content size. Must be between 0 and
256 (inclusive).endStream
- Indicates whether this is the last frame to be sent from the remote endpoint
for this stream.public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endOfStream)
Http2FrameListener
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.
Http2FrameListener.onHeadersRead(ChannelHandlerContext, int, Http2Headers, int, boolean)
Http2FrameListener.onHeadersRead(ChannelHandlerContext, int, Http2Headers, int, short, boolean, int, boolean)
Http2FrameListener.onPushPromiseRead(ChannelHandlerContext, int, int, Http2Headers, int)
To say it another way; the Http2Headers
will contain all of the headers
for the current message exchange step (additional queuing is not necessary).
onHeadersRead
in interface Http2FrameListener
onHeadersRead
in class Http2FrameAdapter
ctx
- the context from the handler where the frame was read.streamId
- the subject stream for the frame.headers
- the received headers.padding
- additional bytes that should be added to obscure the true content size. Must be between 0 and
256 (inclusive).endOfStream
- Indicates whether this is the last frame to be sent from the remote endpoint
for this stream.public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream)
Http2FrameListener
DATA
frame.onDataRead
in interface Http2FrameListener
onDataRead
in class Http2FrameAdapter
ctx
- the context from the handler where the frame was read.streamId
- the subject stream for the frame.data
- payload buffer for the frame. This buffer will be released by the codec.padding
- additional bytes that should be added to obscure the true content size. Must be between 0 and
256 (inclusive).endOfStream
- Indicates whether this is the last frame to be sent from the remote endpoint for this stream.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
.