Package io.netty.handler.codec.spdy
Class SpdyHttpDecoder
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.MessageToMessageDecoder<SpdyFrame>
-
- io.netty.handler.codec.spdy.SpdyHttpDecoder
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class SpdyHttpDecoder extends io.netty.handler.codec.MessageToMessageDecoder<SpdyFrame>
DecodesSpdySynStreamFrame
s,SpdySynReplyFrame
s, andSpdyDataFrame
s intoFullHttpRequest
s andFullHttpResponse
s.
-
-
Constructor Summary
Constructors Modifier Constructor Description SpdyHttpDecoder(SpdyVersion version, int maxContentLength)
Creates a new instance.SpdyHttpDecoder(SpdyVersion version, int maxContentLength, boolean validateHeaders)
Deprecated.Use theSpdyHttpDecoder(SpdyVersion, int, Map, HttpHeadersFactory, HttpHeadersFactory)
constructor instead.protected
SpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer,FullHttpMessage> messageMap)
Creates a new instance with the specified parameters.protected
SpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer,FullHttpMessage> messageMap, boolean validateHeaders)
Deprecated.Use theSpdyHttpDecoder(SpdyVersion, int, Map, HttpHeadersFactory, HttpHeadersFactory)
constructor instead.protected
SpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer,FullHttpMessage> messageMap, HttpHeadersFactory headersFactory, HttpHeadersFactory trailersFactory)
Creates a new instance with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
protected void
decode(io.netty.channel.ChannelHandlerContext ctx, SpdyFrame msg, List<Object> out)
protected FullHttpMessage
getMessage(int streamId)
protected FullHttpMessage
putMessage(int streamId, FullHttpMessage message)
protected FullHttpMessage
removeMessage(int streamId)
-
Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder
acceptInboundMessage, channelRead, channelReadComplete
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
SpdyHttpDecoder
public SpdyHttpDecoder(SpdyVersion version, int maxContentLength)
Creates a new instance.- Parameters:
version
- the protocol versionmaxContentLength
- the maximum length of the message content. If the length of the message content exceeds this value, aTooLongFrameException
will be raised.
-
SpdyHttpDecoder
@Deprecated public SpdyHttpDecoder(SpdyVersion version, int maxContentLength, boolean validateHeaders)
Deprecated.Use theSpdyHttpDecoder(SpdyVersion, int, Map, HttpHeadersFactory, HttpHeadersFactory)
constructor instead.Creates a new instance.- Parameters:
version
- the protocol versionmaxContentLength
- the maximum length of the message content. If the length of the message content exceeds this value, aTooLongFrameException
will be raised.validateHeaders
-true
if http headers should be validated
-
SpdyHttpDecoder
protected SpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer,FullHttpMessage> messageMap)
Creates a new instance with the specified parameters.- Parameters:
version
- the protocol versionmaxContentLength
- the maximum length of the message content. If the length of the message content exceeds this value, aTooLongFrameException
will be raised.messageMap
- theMap
used to hold partially received messages.
-
SpdyHttpDecoder
@Deprecated protected SpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer,FullHttpMessage> messageMap, boolean validateHeaders)
Deprecated.Use theSpdyHttpDecoder(SpdyVersion, int, Map, HttpHeadersFactory, HttpHeadersFactory)
constructor instead.Creates a new instance with the specified parameters.- Parameters:
version
- the protocol versionmaxContentLength
- the maximum length of the message content. If the length of the message content exceeds this value, aTooLongFrameException
will be raised.messageMap
- theMap
used to hold partially received messages.validateHeaders
-true
if http headers should be validated
-
SpdyHttpDecoder
protected SpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer,FullHttpMessage> messageMap, HttpHeadersFactory headersFactory, HttpHeadersFactory trailersFactory)
Creates a new instance with the specified parameters.- Parameters:
version
- the protocol versionmaxContentLength
- the maximum length of the message content. If the length of the message content exceeds this value, aTooLongFrameException
will be raised.messageMap
- theMap
used to hold partially received messages.headersFactory
- The factory used for creating HTTP headerstrailersFactory
- The factory used for creating HTTP trailers.
-
-
Method Detail
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
- Specified by:
channelInactive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelInactive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
putMessage
protected FullHttpMessage putMessage(int streamId, FullHttpMessage message)
-
getMessage
protected FullHttpMessage getMessage(int streamId)
-
removeMessage
protected FullHttpMessage removeMessage(int streamId)
-
-