@UnstableApi public final class InboundHttp2ToHttpPriorityAdapter extends InboundHttp2ToHttpAdapter
InboundHttp2ToHttpAdapter
may generate multiple FullHttpMessage
objects per stream, this class is more likely to
generate multiple messages per stream because the chances of an HTTP/2 event happening outside
the header/data message flow is more likely.connection, validateHttpHeaders
Modifier and Type | Method and Description |
---|---|
protected void |
fireChannelRead(ChannelHandlerContext ctx,
FullHttpMessage msg,
boolean release,
Http2Stream stream)
Set final headers and fire a channel read event
|
void |
onPriorityRead(ChannelHandlerContext ctx,
int streamId,
int streamDependency,
short weight,
boolean exclusive)
Handles an inbound
PRIORITY frame. |
void |
onPriorityTreeParentChanged(Http2Stream stream,
Http2Stream oldParent)
Notifies the listener that a priority tree parent change has occurred.
|
void |
onWeightChanged(Http2Stream stream,
short oldWeight)
Notifies the listener that the weight has changed for
stream . |
protected FullHttpMessage |
processHeadersBegin(ChannelHandlerContext ctx,
Http2Stream stream,
Http2Headers headers,
boolean endOfStream,
boolean allowAppend,
boolean appendToTrailer)
Provides translation between HTTP/2 and HTTP header objects while ensuring the stream
is in a valid state for additional headers.
|
getMessage, newMessage, onDataRead, onHeadersRead, onHeadersRead, onPushPromiseRead, onRstStreamRead, onRstStreamRead, onSettingsRead, onStreamRemoved, putMessage, removeMessage
onGoAwayRead, onGoAwayReceived, onGoAwaySent, onPingAckRead, onPingRead, onPriorityTreeParentChanging, onSettingsAckRead, onStreamActive, onStreamAdded, onStreamClosed, onStreamHalfClosed, onUnknownFrame, onWindowUpdateRead
protected void fireChannelRead(ChannelHandlerContext ctx, FullHttpMessage msg, boolean release, Http2Stream stream)
InboundHttp2ToHttpAdapter
fireChannelRead
in class InboundHttp2ToHttpAdapter
ctx
- The context to fire the event onmsg
- The message to sendrelease
- true
to release if present in #messageMap
. false
otherwise.stream
- the stream of the message which is being firedprotected FullHttpMessage processHeadersBegin(ChannelHandlerContext ctx, Http2Stream stream, Http2Headers headers, boolean endOfStream, boolean allowAppend, boolean appendToTrailer) throws Http2Exception
InboundHttp2ToHttpAdapter
processHeadersBegin
in class InboundHttp2ToHttpAdapter
ctx
- The context for which this message has been received.
Used to send informational header if detected.stream
- The stream the headers
apply toheaders
- The headers to processendOfStream
- true
if the stream
has received the end of stream flagallowAppend
- true
if headers will be appended if the stream already exists.false
and the stream already exists this method returns null
.appendToTrailer
- true
if a message stream
already exists then the headers
should be added to the trailing headers.false
then appends will be done to the initial headers.stream
. null
if
allowAppend
is false
and the stream already exists.Http2Exception
- If the stream id is not in the correct state to process the headers requestpublic void onPriorityTreeParentChanged(Http2Stream stream, Http2Stream oldParent)
Http2Connection.Listener
If a RuntimeException
is thrown it will be logged and not propagated.
Throwing from this method is not supported and is considered a programming error.
onPriorityTreeParentChanged
in interface Http2Connection.Listener
onPriorityTreeParentChanged
in class Http2EventAdapter
stream
- The stream which had a parent change (new parent and children will be steady state)oldParent
- The old parent which stream
used to be a child of (may be null
)public void onWeightChanged(Http2Stream stream, short oldWeight)
Http2Connection.Listener
stream
.
If a RuntimeException
is thrown it will be logged and not propagated.
Throwing from this method is not supported and is considered a programming error.
onWeightChanged
in interface Http2Connection.Listener
onWeightChanged
in class Http2EventAdapter
stream
- The stream which the weight has changedoldWeight
- The old weight for stream
public void onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight, boolean exclusive) throws Http2Exception
Http2FrameListener
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.
onPriorityRead
in interface Http2FrameListener
onPriorityRead
in class Http2EventAdapter
ctx
- the context from the handler where the frame was read.streamId
- the subject stream for the frame.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.Http2Exception
Copyright © 2008–2016 The Netty Project. All rights reserved.