content-encoding header for each
stream. The decompression provided by this class will be applied to the data for the entire stream.
| Modifier and Type | Class and Description |
|---|---|
| private class | DelegatingDecompressorFrameListener.
A decorator around the local flow controller that converts consumed bytes from uncompressed to compressed. |
| private static class | DelegatingDecompressorFrameListener.
Provides the state for stream |
| Modifier and Type | Field and Description |
|---|---|
| private final Http2Connection | |
| private boolean | |
| private final Http2Connection. | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DelegatingDecompressorFrameListener(Http2Connection connection, Http2FrameListener listener, boolean strict)
|
| Modifier and Type | Method and Description |
|---|---|
| private static void | cleanup(DelegatingDecompressorFrameListener.
The decompressor for decompressorstreamRelease remaining content from the |
| pack-priv DelegatingDecompressorFrameListener. | |
| protected CharSequence | Returns: the expected content encoding of the new content.the value of the contentEncoding)content-encoding headerReturns the expected content encoding of the decoded content. |
| private void | initDecompressor(ChannelHandlerContext
The context ctx, int The identifier for the headers inside streamId, Http2Headers headersObject representing headers which have been read headers, boolean Indicates if the stream has ended endOfStream)Checks if a new decompressor object is needed for the stream identified by |
| protected EmbeddedChannel | Returns: a newByteToMessageDecoder if the specified encoding is supported. null otherwise
(alternatively, you can throw a Http2Exception to block unknown encoding).the value of the contentEncoding)content-encoding headerReturns a new |
| private static ByteBuf | nextReadableBuf(EmbeddedChannel
The channel to read from decompressor)Read the next decompressed |
| 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. Implements io. 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. Implements io. 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. Implements io. HEADERS frame with priority information specified.
|
| connection | back to summary |
|---|---|
| private final Http2Connection connection | |
| flowControllerInitialized | back to summary |
|---|---|
| private boolean flowControllerInitialized | |
| propertyKey | back to summary |
|---|---|
| private final Http2Connection. | |
| strict | back to summary |
|---|---|
| private final boolean strict | |
| DelegatingDecompressorFrameListener | back to summary |
|---|---|
| public DelegatingDecompressorFrameListener(Http2Connection connection, Http2FrameListener listener) | |
| DelegatingDecompressorFrameListener | back to summary |
|---|---|
| public DelegatingDecompressorFrameListener(Http2Connection connection, Http2FrameListener listener, boolean strict) | |
| cleanup | back to summary |
|---|---|
| private static void cleanup(DelegatingDecompressorFrameListener. Release remaining content from the
| |
| decompressor | back to summary |
|---|---|
| pack-priv DelegatingDecompressorFrameListener. | |
| getTargetContentEncoding | back to summary |
|---|---|
| protected CharSequence getTargetContentEncoding(CharSequence contentEncoding) throws Http2Exception Returns the expected content encoding of the decoded content. This getMethod returns
| |
| initDecompressor | back to summary |
|---|---|
| private void initDecompressor(ChannelHandlerContext ctx, int streamId, Http2Headers headers, boolean endOfStream) throws Http2Exception Checks if a new decompressor object is needed for the stream identified by
| |
| newContentDecompressor | back to summary |
|---|---|
| protected EmbeddedChannel newContentDecompressor(final ChannelHandlerContext ctx, CharSequence contentEncoding) throws Http2Exception Returns a new
| |
| nextReadableBuf | back to summary |
|---|---|
| private static ByteBuf nextReadableBuf(EmbeddedChannel decompressor) Read the next decompressed
| |
| onDataRead | back to summary |
|---|---|
| public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) throws Http2Exception Overrides io. Implements io. Doc from io. Handles an inbound
| |
| onHeadersRead | back to summary |
|---|---|
| public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream) throws Http2Exception Overrides io. Implements io. Doc from io. Handles an inbound
Only one of the following methods will be called for each
To say it another way; the
| |
| onHeadersRead | back 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. Implements io. Doc from io. Handles an inbound
Only one of the following methods will be called for each
To say it another way; the
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Http2LocalFlowController |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | channelHandlerContext(ChannelHandlerContext
The ctx)ChannelHandlerContext for which to apply flow control on.Implements io. ChannelHandlerContext for which to apply flow control on.
|
| public boolean | consumeBytes(Http2Stream
the stream for which window space should be freed. The connection stream object must not be used.
If stream, int stream is null or closed (i.e. Http2Stream#state() method returns Http2Stream.), calling this method has no effect.the number of bytes to be returned to the flow control window. numBytes)Implements io. |
| public Http2LocalFlowController | frameWriter(Http2FrameWriter
the HTTP/2 frame writer. frameWriter)Implements io. WINDOW_UPDATE frames.
|
| public void | incrementWindowSize(Http2Stream
The subject stream. Use stream, int Http2Connection#connectionStream() for
requesting the size of the connection window.the change in size of the flow control window. delta)Implements io. |
| public void | initialWindowSize(int
the new initial window size. newWindowSize)Implements io. |
| public int | initialWindowSize()
Implements io. |
| public int | initialWindowSize(Http2Stream stream)
Implements io. |
| public void | receiveFlowControlledFrame(Http2Stream
the subject stream for the received frame. The connection stream object must not be used. If stream, ByteBuf stream is null or closed, flow control should only be applied to the connection window and the bytes are
immediately consumed.payload buffer for the frame. 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. DATA frame from the remote endpoint and applies flow control policies to it for both
the stream as well as the connection.
|
| public int | unconsumedBytes(Http2Stream
the stream for which window space should be freed. stream)Implements io. |
| public int | windowSize(Http2Stream stream)
Implements io. |
| flowController | back to summary |
|---|---|
| private final Http2LocalFlowController flowController | |
| ConsumedBytesConverter | back to summary |
|---|---|
| pack-priv ConsumedBytesConverter(Http2LocalFlowController flowController) | |
| channelHandlerContext | back to summary |
|---|---|
| public void channelHandlerContext(ChannelHandlerContext ctx) throws Http2Exception Implements io. Doc from io. Set the
This must be called to properly initialize the
| |
| consumeBytes | back to summary |
|---|---|
| public boolean consumeBytes(Http2Stream stream, int numBytes) throws Http2Exception Implements io. Doc from io. Indicates that the application has consumed a number of bytes for the given stream and is therefore ready to
receive more data from the remote endpoint. The application must consume any bytes that it receives or the flow
control window will collapse. Consuming bytes enables the flow controller to send
If
| |
| frameWriter | back to summary |
|---|---|
| public Http2LocalFlowController frameWriter(Http2FrameWriter frameWriter) Implements io. Doc from io. Sets the writer to be use for sending
| |
| incrementWindowSize | back to summary |
|---|---|
| public void incrementWindowSize(Http2Stream stream, int delta) throws Http2Exception Implements io. Doc from io. Increments the size of the stream's flow control window by the given delta.
In the case of a
For a
| |
| initialWindowSize | back to summary |
|---|---|
| public void initialWindowSize(int newWindowSize) throws Http2Exception Implements io. Doc from io. Sets the connection-wide initial flow control window and updates all stream windows (but not the connection stream window) by the delta.
Represents the value for
SETTINGS_INITIAL_WINDOW_SIZE. This method should
only be called by Netty (not users) as a result of a receiving a
| |
| initialWindowSize | back to summary |
|---|---|
| public int initialWindowSize() Implements io. Doc from io. Gets the connection-wide initial flow control window size that is used as the basis for new stream flow control windows.
Represents the value for
SETTINGS_INITIAL_WINDOW_SIZE. The initial value
returned by this method must be
| |
| initialWindowSize | back to summary |
|---|---|
| public int initialWindowSize(Http2Stream stream) Implements io. Doc from io. Get the initial flow control window size for the given stream. This quantity is measured in number of bytes. Note
the unavailable window portion can be calculated by
| |
| receiveFlowControlledFrame | back to summary |
|---|---|
| public void receiveFlowControlledFrame(Http2Stream stream, ByteBuf data, int padding, boolean endOfStream) throws Http2Exception Implements io. Doc from io. Receives an inbound
If
| |
| unconsumedBytes | back to summary |
|---|---|
| public int unconsumedBytes(Http2Stream stream) Implements io. Doc from io. The number of bytes for the given stream that have been received but not yet consumed by the application.
| |
| windowSize | back to summary |
|---|---|
| public int windowSize(Http2Stream stream) Implements io. Doc from io. Get the portion of the flow control window for the given stream that is currently available for sending/receiving frames which are subject to flow control. This quantity is measured in number of bytes.
| |
DATA frame decompression.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private final EmbeddedChannel |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | Returns: The number of pre-decompressed bytes that have been consumed.the stream ID streamId, int The number of post-decompressed bytes to return to flow control decompressedBytes)Determines the ratio between |
| pack-priv EmbeddedChannel | |
| pack-priv void | incrementCompressedBytes(int delta)
Increment the number of bytes received prior to doing any decompression. |
| pack-priv void |
| compressed | back to summary |
|---|---|
| private int compressed | |
| decompressed | back to summary |
|---|---|
| private int decompressed | |
| decompressor | back to summary |
|---|---|
| private final EmbeddedChannel decompressor | |
| Http2Decompressor | back to summary |
|---|---|
| pack-priv Http2Decompressor(EmbeddedChannel decompressor) | |
| consumeBytes | back to summary |
|---|---|
| pack-priv int consumeBytes(int streamId, int decompressedBytes) throws Http2Exception Determines the ratio between
| |
| decompressor | back to summary |
|---|---|
| pack-priv EmbeddedChannel decompressor() Responsible for taking compressed bytes in and producing decompressed bytes. | |
| incrementCompressedBytes | back to summary |
|---|---|
| pack-priv void incrementCompressedBytes(int delta) Increment the number of bytes received prior to doing any decompression. | |
| incrementDecompressedBytes | back to summary |
|---|---|
| pack-priv void incrementDecompressedBytes(int delta) Increment the number of bytes after the decompression process. | |