Top Description Constructors Methods
io.netty5.handler.codec.http2

public Class Http2FrameAdapter

extends Object
implements Http2FrameListener
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.http2.Http2FrameListener
Annotations
@UnstableApi
Imports
io.netty5.buffer.Buffer, io.netty5.channel.ChannelHandlerContext, io.netty5.handler.codec.http2.headers.Http2Headers, io.netty5.util.internal.UnstableApi

Convenience class that provides no-op implementations for all methods of Http2FrameListener.

Constructor Summary

AccessConstructor and Description
public

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
,
Buffer
payload buffer for the frame. This buffer will be closed by the codec when the method returns (the buffer will be inaccessible after the method call).
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
)

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

Handles an inbound DATA frame.
public void
onGoAwayRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the last known stream of the remote endpoint.
lastStreamId
,
long
the error code, if abnormal closure.
errorCode
,
Buffer
application-defined debug data. This buffer will be closed by the codec when the method returns (the buffer will be inaccessible after the method call).
debugData
)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onGoAwayRead.

Handles an inbound GO_AWAY 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
)

Implements io.netty5.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
)

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

Handles an inbound HEADERS frame with priority information specified.
public void
onPingAckRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
long
the payload of the frame.
data
)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onPingAckRead.

Handles an inbound PING acknowledgment.
public void
onPingRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
long
the payload of the frame.
data
)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onPingRead.

Handles an inbound PING frame.
public void
onPriorityRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the subject stream for the frame.
streamId
,
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
)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onPriorityRead.

Handles an inbound PRIORITY frame.
public void
onPushPromiseRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the stream the frame was sent on.
streamId
,
int
the ID of the promised stream.
promisedStreamId
,
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
)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onPushPromiseRead.

Handles an inbound PUSH_PROMISE frame.
public void
onRstStreamRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the stream that is terminating.
streamId
,
long
the error code identifying the type of failure.
errorCode
)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onRstStreamRead.

Handles an inbound RST_STREAM frame.
public void
onSettingsAckRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onSettingsAckRead.

Handles an inbound SETTINGS acknowledgment frame.
public void
onSettingsRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
Http2Settings
the settings received from the remote endpoint.
settings
)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onSettingsRead.

Handles an inbound SETTINGS frame.
public void
onUnknownFrame(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
byte
the frame type from the HTTP/2 header.
frameType
,
int
the stream the frame was sent on.
streamId
,
Http2Flags
the flags in the frame header.
flags
,
Buffer
the payload of the frame. This buffer will be closed by the codec when the method returns (the buffer will be inaccessible after the method call).
payload
)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onUnknownFrame.

Handler for a frame not defined by the HTTP/2 spec.
public void
onWindowUpdateRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the stream the frame was sent on.
streamId
,
int
the increased number of bytes of the remote endpoint's flow control window.
windowSizeIncrement
)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onWindowUpdateRead.

Handles an inbound WINDOW_UPDATE frame.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Http2FrameAdapterback to summary
public Http2FrameAdapter()

Method Detail

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

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

Doc from io.netty5.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:Buffer

payload buffer for the frame. This buffer will be closed by the codec when the method returns (the buffer will be inaccessible after the method call).

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
onGoAwayReadback to summary
public void onGoAwayRead(ChannelHandlerContext ctx, int lastStreamId, long errorCode, Buffer debugData) throws Http2Exception

Implements io.netty5.handler.codec.http2.Http2FrameListener.onGoAwayRead.

Doc from io.netty5.handler.codec.http2.Http2FrameListener.onGoAwayRead.

Handles an inbound GO_AWAY frame.

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

lastStreamId:int

the last known stream of the remote endpoint.

errorCode:long

the error code, if abnormal closure.

debugData:Buffer

application-defined debug data. This buffer will be closed by the codec when the method returns (the buffer will be inaccessible after the method call).

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

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

Doc from io.netty5.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

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

Doc from io.netty5.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
onPingAckReadback to summary
public void onPingAckRead(ChannelHandlerContext ctx, long data) throws Http2Exception

Implements io.netty5.handler.codec.http2.Http2FrameListener.onPingAckRead.

Doc from io.netty5.handler.codec.http2.Http2FrameListener.onPingAckRead.

Handles an inbound PING acknowledgment.

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

data:long

the payload of the frame.

Annotations
@Override
onPingReadback to summary
public void onPingRead(ChannelHandlerContext ctx, long data) throws Http2Exception

Implements io.netty5.handler.codec.http2.Http2FrameListener.onPingRead.

Doc from io.netty5.handler.codec.http2.Http2FrameListener.onPingRead.

Handles an inbound PING frame.

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

data:long

the payload of the frame.

Annotations
@Override
onPriorityReadback to summary
public void onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight, boolean exclusive) throws Http2Exception

Implements io.netty5.handler.codec.http2.Http2FrameListener.onPriorityRead.

Doc from io.netty5.handler.codec.http2.Http2FrameListener.onPriorityRead.

Handles an inbound PRIORITY frame.

Note that is it possible to have this method called and no stream object exist for either streamId, streamDependency, or both. This is because the PRIORITY frame can be sent/received when streams are in the CLOSED state.

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

streamId:int

the subject stream for the frame.

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.

Annotations
@Override
onPushPromiseReadback to summary
public void onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding) throws Http2Exception

Implements io.netty5.handler.codec.http2.Http2FrameListener.onPushPromiseRead.

Doc from io.netty5.handler.codec.http2.Http2FrameListener.onPushPromiseRead.

Handles an inbound PUSH_PROMISE frame. Only called if END_HEADERS encountered.

Promised requests MUST be authoritative, cacheable, and safe. See [RFC 7540], Section 8.2.

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 stream the frame was sent on.

promisedStreamId:int

the ID of the promised stream.

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).

Annotations
@Override
onRstStreamReadback to summary
public void onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) throws Http2Exception

Implements io.netty5.handler.codec.http2.Http2FrameListener.onRstStreamRead.

Doc from io.netty5.handler.codec.http2.Http2FrameListener.onRstStreamRead.

Handles an inbound RST_STREAM frame.

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

streamId:int

the stream that is terminating.

errorCode:long

the error code identifying the type of failure.

Annotations
@Override
onSettingsAckReadback to summary
public void onSettingsAckRead(ChannelHandlerContext ctx) throws Http2Exception

Implements io.netty5.handler.codec.http2.Http2FrameListener.onSettingsAckRead.

Doc from io.netty5.handler.codec.http2.Http2FrameListener.onSettingsAckRead.

Handles an inbound SETTINGS acknowledgment frame.

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

Annotations
@Override
onSettingsReadback to summary
public void onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings) throws Http2Exception

Implements io.netty5.handler.codec.http2.Http2FrameListener.onSettingsRead.

Doc from io.netty5.handler.codec.http2.Http2FrameListener.onSettingsRead.

Handles an inbound SETTINGS frame.

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

settings:Http2Settings

the settings received from the remote endpoint.

Annotations
@Override
onUnknownFrameback to summary
public void onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, Buffer payload)

Implements io.netty5.handler.codec.http2.Http2FrameListener.onUnknownFrame.

Doc from io.netty5.handler.codec.http2.Http2FrameListener.onUnknownFrame.

Handler for a frame not defined by the HTTP/2 spec.

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

frameType:byte

the frame type from the HTTP/2 header.

streamId:int

the stream the frame was sent on.

flags:Http2Flags

the flags in the frame header.

payload:Buffer

the payload of the frame. This buffer will be closed by the codec when the method returns (the buffer will be inaccessible after the method call).

Annotations
@Override
onWindowUpdateReadback to summary
public void onWindowUpdateRead(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement) throws Http2Exception

Implements io.netty5.handler.codec.http2.Http2FrameListener.onWindowUpdateRead.

Doc from io.netty5.handler.codec.http2.Http2FrameListener.onWindowUpdateRead.

Handles an inbound WINDOW_UPDATE frame.

Parameters
ctx:ChannelHandlerContext

the context from the handler where the frame was read.

streamId:int

the stream the frame was sent on.

windowSizeIncrement:int

the increased number of bytes of the remote endpoint's flow control window.

Annotations
@Override