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.Modifier and Type | Class and Description |
---|---|
static class |
InboundHttp2ToHttpPriorityAdapter.Builder |
connection, messageMap, validateHttpHeaders
Modifier and Type | Method and Description |
---|---|
protected void |
fireChannelRead(ChannelHandlerContext ctx,
FullHttpMessage msg,
int streamId)
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 |
onWeightChanged(Http2Stream stream,
short oldWeight)
Notifies the listener that the weight has changed for
stream |
void |
priorityTreeParentChanged(Http2Stream stream,
Http2Stream oldParent)
Notifies the listener that a priority tree parent change has occurred.
|
protected FullHttpMessage |
processHeadersBegin(ChannelHandlerContext ctx,
int streamId,
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.
|
protected void |
removeMessage(int streamId)
The streamId is out of scope for the HTTP message flow and will no longer be tracked
|
newMessage, onDataRead, onHeadersRead, onHeadersRead, onPushPromiseRead, onRstStreamRead, onSettingsRead, streamRemoved
goingAway, onGoAwayRead, onPingAckRead, onPingRead, onSettingsAckRead, onUnknownFrame, onWindowUpdateRead, priorityTreeParentChanging, streamActive, streamAdded, streamHalfClosed, streamInactive
protected void removeMessage(int streamId)
InboundHttp2ToHttpAdapter
removeMessage
in class InboundHttp2ToHttpAdapter
streamId
- The stream id to remove associated state withprotected void fireChannelRead(ChannelHandlerContext ctx, FullHttpMessage msg, int streamId)
InboundHttp2ToHttpAdapter
fireChannelRead
in class InboundHttp2ToHttpAdapter
ctx
- The context to fire the event onmsg
- The message to sendstreamId
- the streamId of the message which is being firedprotected FullHttpMessage processHeadersBegin(ChannelHandlerContext ctx, int streamId, 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.streamId
- The stream id the headers
apply toheaders
- The headers to processendOfStream
- true
if the streamId
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 streamId
already exists then the headers
should be added to the trailing headers.false
then appends will be done to the initial headers.streamId
. 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 priorityTreeParentChanged(Http2Stream stream, Http2Stream oldParent)
Http2Connection.Listener
priorityTreeParentChanged
in interface Http2Connection.Listener
priorityTreeParentChanged
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
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
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–2015 The Netty Project. All rights reserved.