See HttpToHttp2ConnectionHandler to get translation from HTTP/1.x objects to HTTP/2 frames for writes.
| Modifier and Type | Class and Description |
|---|---|
| private static interface | InboundHttp2ToHttpAdapter.
Allows messages to be sent up the pipeline before the next phase in the HTTP message flow is detected. |
| Modifier and Type | Field and Description |
|---|---|
| protected final Http2Connection | |
| private static final InboundHttp2ToHttpAdapter. | |
| private final int | |
| private final Http2Connection. | |
| private final boolean | |
| private final InboundHttp2ToHttpAdapter. | |
| protected final boolean |
| Access | Constructor and Description |
|---|---|
| protected | InboundHttp2ToHttpAdapter(Http2Connection connection, int maxContentLength, boolean validateHttpHeaders, boolean propagateSettings)
|
| Modifier and Type | Method and Description |
|---|---|
| protected void | fireChannelRead(ChannelHandlerContext
The context to fire the event on ctx, FullHttpMessage<?> The message to send msg, boolean true to call release on the value if it is present. false to not call release.the stream of the message which is being fired stream)Set final headers and fire a channel read event |
| protected final FullHttpMessage | getMessage(Http2Stream
The stream to get the associated state from stream)Get the |
| protected FullHttpMessage | newMessage(Http2Stream
The stream to create a message for stream, Http2Headers The headers associated with headers, boolean stream
The alloc)BufferAllocator to use to generate the content of the messageCreate a new |
| 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)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. endOfStream)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. endOfStream)Overrides io. Implements io. HEADERS frame with priority information specified.
|
| 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)Overrides io. Implements io. 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)Overrides io. Implements io. RST_STREAM frame.
|
| protected void | onRstStreamRead(Http2Stream stream, FullHttpMessage<?> msg)
Called if a |
| public void | onSettingsRead(ChannelHandlerContext
the context from the handler where the frame was read. ctx, Http2Settings the settings received from the remote endpoint. settings)Overrides io. Implements io. SETTINGS frame.
|
| public void | onStreamRemoved(Http2Stream stream)
Overrides io. Implements io. Http2Connection#stream(int).
|
| protected FullHttpMessage | Returns: The object used to track the stream corresponding tostream. null if
allowAppend is false and the stream already exists.The context for which this message has been received.
Used to send informational header if detected. ctx, Http2Stream The stream the stream, Http2Headers headers apply toThe headers to process headers, boolean true if the stream has received the end of stream flag
Provides translation between HTTP/2 and HTTP header objects while ensuring the stream is in a valid state for additional headers. |
| private void | processHeadersEnd(ChannelHandlerContext
The context for which this message has been received ctx, Http2Stream The stream the stream, FullHttpMessage<?> objAccumulator corresponds toThe object which represents all headers/data for corresponding to msg, boolean streamtrue if this is the last event for the streamAfter HTTP/2 headers have been processed by |
| protected final void | putMessage(Http2Stream
The stream which stream, FullHttpMessage<?> message is associated with.The message which contains the HTTP semantics. message)Make |
| protected final void | removeMessage(Http2Stream
The stream to remove associated state with stream, boolean true to call release on the value if it is present. false to not call release.The stream is out of scope for the HTTP message flow and will no longer be tracked |
| connection | back to summary |
|---|---|
| protected final Http2Connection connection | |
| DEFAULT_SEND_DETECTOR | back to summary |
|---|---|
| private static final InboundHttp2ToHttpAdapter. | |
| maxContentLength | back to summary |
|---|---|
| private final int maxContentLength | |
| messageKey | back to summary |
|---|---|
| private final Http2Connection. | |
| propagateSettings | back to summary |
|---|---|
| private final boolean propagateSettings | |
| sendDetector | back to summary |
|---|---|
| private final InboundHttp2ToHttpAdapter. | |
| validateHttpHeaders | back to summary |
|---|---|
| protected final boolean validateHttpHeaders | |
| InboundHttp2ToHttpAdapter | back to summary |
|---|---|
| protected InboundHttp2ToHttpAdapter(Http2Connection connection, int maxContentLength, boolean validateHttpHeaders, boolean propagateSettings) | |
| fireChannelRead | back to summary |
|---|---|
| protected void fireChannelRead(ChannelHandlerContext ctx, FullHttpMessage<?> msg, boolean release, Http2Stream stream) Set final headers and fire a channel read event
| |
| getMessage | back to summary |
|---|---|
| protected final FullHttpMessage Get the
| |
| newMessage | back to summary |
|---|---|
| protected FullHttpMessage Create a new
| |
| onDataRead | back to summary |
|---|---|
| public int onDataRead(ChannelHandlerContext ctx, int streamId, Buffer 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 endOfStream) 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 endOfStream) 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
| |
| onPushPromiseRead | back to summary |
|---|---|
| public void onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding) throws Http2Exception Overrides io. Implements io. Doc from io. Handles an inbound 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
To say it another way; the
| |
| onRstStreamRead | back to summary |
|---|---|
| public void onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) throws Http2Exception Overrides io. Implements io. Doc from io. Handles an inbound
| |
| onRstStreamRead | back to summary |
|---|---|
| protected void onRstStreamRead(Http2Stream stream, FullHttpMessage<?> msg) Called if a | |
| onSettingsRead | back to summary |
|---|---|
| public void onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings) throws Http2Exception Overrides io. Implements io. Doc from io. Handles an inbound
| |
| onStreamRemoved | back to summary |
|---|---|
| public void onStreamRemoved(Http2Stream stream) Overrides io. Implements io. Doc from io. Notifies the listener that the given stream has now been removed from the connection and
will no longer be returned via
If a
| |
| processHeadersBegin | back to summary |
|---|---|
| protected FullHttpMessage Provides translation between HTTP/2 and HTTP header objects while ensuring the stream is in a valid state for additional headers.
| |
| processHeadersEnd | back to summary |
|---|---|
| private void processHeadersEnd(ChannelHandlerContext ctx, Http2Stream stream, FullHttpMessage<?> msg, boolean endOfStream) After HTTP/2 headers have been processed by
| |
| putMessage | back to summary |
|---|---|
| protected final void putMessage(Http2Stream stream, FullHttpMessage<?> message) Make
| |
| removeMessage | back to summary |
|---|---|
| protected final void removeMessage(Http2Stream stream, boolean release) The stream is out of scope for the HTTP message flow and will no longer be tracked
| |
| Modifier and Type | Method and Description |
|---|---|
| public FullHttpMessage | Returns: A modified copy of themsg or null if a copy is not needed.The allocator, FullHttpMessage<?> BufferAllocator that can be used to allocateThe message which has just been sent due to msg)mustSendImmediately(FullHttpMessage)Determine if a copy must be made after an immediate send happens. |
| public boolean | Returns: true if the message should be sent immediately
{@code false) if we should wait for the end of the streamThe response to test msg)Determine if the response should be sent immediately, or wait for the end of the stream |
| copyIfNeeded | back to summary |
|---|---|
| public FullHttpMessage Determine if a copy must be made after an immediate send happens. An example of this use case is if a request is received with a 'Expect: 100-continue' header. The message will be sent immediately, and the data will be queued and sent at the end of the stream.
| |
| mustSendImmediately | back to summary |
|---|---|
| public boolean mustSendImmediately(FullHttpMessage<?> msg) Determine if the response should be sent immediately, or wait for the end of the stream
| |