Top Description Fields Constructors Methods
io.netty.handler.codec.spdy

public Class SpdyHttpDecoder

extends MessageToMessageDecoder<SpdyFrame>
Class Inheritance
Imports
io.netty.buffer.ByteBuf, .ByteBufAllocator, io.netty.channel.ChannelHandlerContext, io.netty.handler.codec.MessageToMessageDecoder, .TooLongFrameException, io.netty.handler.codec.http.DefaultFullHttpRequest, .DefaultFullHttpResponse, .FullHttpMessage, .FullHttpRequest, .FullHttpResponse, .HttpHeaderNames, .DefaultHttpHeadersFactory, .HttpHeadersFactory, .HttpUtil, .HttpMethod, .HttpResponseStatus, .HttpVersion, io.netty.handler.codec.spdy.SpdyHttpHeaders.Names, io.netty.util.ReferenceCountUtil, io.netty.util.internal.ObjectUtil, java.util.HashMap, .List, .Map

Decodes SpdySynStreamFrames, SpdySynReplyFrames, and SpdyDataFrames into FullHttpRequests and FullHttpResponses.

Field Summary

Modifier and TypeField and Description
private final HttpHeadersFactory
private final int
private final Map<Integer, FullHttpMessage>
private final int
private final HttpHeadersFactory

Constructor Summary

AccessConstructor and Description
public
SpdyHttpDecoder(SpdyVersion
the protocol version
version
,
int
the maximum length of the message content. If the length of the message content exceeds this value, a TooLongFrameException will be raised.
maxContentLength
)

Creates a new instance.

public
SpdyHttpDecoder(SpdyVersion
the protocol version
version
,
int
the maximum length of the message content. If the length of the message content exceeds this value, a TooLongFrameException will be raised.
maxContentLength
,
boolean
true if http headers should be validated
validateHeaders
)

Creates a new instance.
protected
SpdyHttpDecoder(SpdyVersion
the protocol version
version
,
int
the maximum length of the message content. If the length of the message content exceeds this value, a TooLongFrameException will be raised.
maxContentLength
,
Map<Integer, FullHttpMessage>
the Map used to hold partially received messages.
messageMap
)

Creates a new instance with the specified parameters.

protected
SpdyHttpDecoder(SpdyVersion
the protocol version
version
,
int
the maximum length of the message content. If the length of the message content exceeds this value, a TooLongFrameException will be raised.
maxContentLength
,
Map<Integer, FullHttpMessage>
the Map used to hold partially received messages.
messageMap
,
boolean
true if http headers should be validated
validateHeaders
)

Creates a new instance with the specified parameters.
protected
SpdyHttpDecoder(SpdyVersion
the protocol version
version
,
int
the maximum length of the message content. If the length of the message content exceeds this value, a TooLongFrameException will be raised.
maxContentLength
,
Map<Integer, FullHttpMessage>
the Map used to hold partially received messages.
messageMap
,
HttpHeadersFactory
The factory used for creating HTTP headers
headersFactory
,
HttpHeadersFactory
The factory used for creating HTTP trailers.
trailersFactory
)

Creates a new instance with the specified parameters.

Method Summary

Modifier and TypeMethod and Description
public void
private static FullHttpRequest
private FullHttpResponse
protected void
decode(ChannelHandlerContext ctx, SpdyFrame
the message to decode to an other one
msg
,
List<Object>
the List to which decoded messages should be added
out
)

Implements abstract io.netty.handler.codec.MessageToMessageDecoder.decode.

Decode from one message to an other.
protected FullHttpMessage
getMessage(int streamId)

protected FullHttpMessage
putMessage(int streamId, FullHttpMessage message)

protected FullHttpMessage
removeMessage(int streamId)

Inherited from io.netty.handler.codec.MessageToMessageDecoder:
acceptInboundMessagechannelRead

Field Detail

headersFactoryback to summary
private final HttpHeadersFactory headersFactory
maxContentLengthback to summary
private final int maxContentLength
messageMapback to summary
private final Map<Integer, FullHttpMessage> messageMap
spdyVersionback to summary
private final int spdyVersion
trailersFactoryback to summary
private final HttpHeadersFactory trailersFactory

Constructor Detail

SpdyHttpDecoderback to summary
public SpdyHttpDecoder(SpdyVersion version, int maxContentLength)

Creates a new instance.

Parameters
version:SpdyVersion

the protocol version

maxContentLength:int

the maximum length of the message content. If the length of the message content exceeds this value, a TooLongFrameException will be raised.

SpdyHttpDecoderback to summary
public SpdyHttpDecoder(SpdyVersion version, int maxContentLength, boolean validateHeaders)

Creates a new instance.

Parameters
version:SpdyVersion

the protocol version

maxContentLength:int

the maximum length of the message content. If the length of the message content exceeds this value, a TooLongFrameException will be raised.

validateHeaders:boolean

true if http headers should be validated

Annotations
@Deprecated
SpdyHttpDecoderback to summary
protected SpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer, FullHttpMessage> messageMap)

Creates a new instance with the specified parameters.

Parameters
version:SpdyVersion

the protocol version

maxContentLength:int

the maximum length of the message content. If the length of the message content exceeds this value, a TooLongFrameException will be raised.

messageMap:Map<Integer, FullHttpMessage>

the Map used to hold partially received messages.

SpdyHttpDecoderback to summary
protected SpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer, FullHttpMessage> messageMap, boolean validateHeaders)

Creates a new instance with the specified parameters.

Parameters
version:SpdyVersion

the protocol version

maxContentLength:int

the maximum length of the message content. If the length of the message content exceeds this value, a TooLongFrameException will be raised.

messageMap:Map<Integer, FullHttpMessage>

the Map used to hold partially received messages.

validateHeaders:boolean

true if http headers should be validated

Annotations
@Deprecated
SpdyHttpDecoderback to summary
protected SpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer, FullHttpMessage> messageMap, HttpHeadersFactory headersFactory, HttpHeadersFactory trailersFactory)

Creates a new instance with the specified parameters.

Parameters
version:SpdyVersion

the protocol version

maxContentLength:int

the maximum length of the message content. If the length of the message content exceeds this value, a TooLongFrameException will be raised.

messageMap:Map<Integer, FullHttpMessage>

the Map used to hold partially received messages.

headersFactory:HttpHeadersFactory

The factory used for creating HTTP headers

trailersFactory:HttpHeadersFactory

The factory used for creating HTTP trailers.

Method Detail

channelInactiveback to summary
public void channelInactive(ChannelHandlerContext ctx) throws Exception

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelInactive.

Implements io.netty.channel.ChannelInboundHandler.channelInactive.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelInactive.

Calls ChannelHandlerContext#fireChannelInactive() to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
createHttpRequestback to summary
private static FullHttpRequest createHttpRequest(SpdyHeadersFrame requestFrame, ByteBufAllocator alloc) throws Exception
createHttpResponseback to summary
private FullHttpResponse createHttpResponse(SpdyHeadersFrame responseFrame, ByteBufAllocator alloc) throws Exception
decodeback to summary
protected void decode(ChannelHandlerContext ctx, SpdyFrame msg, List<Object> out) throws Exception

Implements abstract io.netty.handler.codec.MessageToMessageDecoder.decode.

Doc from io.netty.handler.codec.MessageToMessageDecoder.decode.

Decode from one message to an other. This method will be called for each written message that can be handled by this decoder.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this MessageToMessageDecoder belongs to

msg:SpdyFrame

the message to decode to an other one

out:List<Object>

the List to which decoded messages should be added

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
getMessageback to summary
protected FullHttpMessage getMessage(int streamId)
putMessageback to summary
protected FullHttpMessage putMessage(int streamId, FullHttpMessage message)
removeMessageback to summary
protected FullHttpMessage removeMessage(int streamId)