Class SpdyHttpDecoder
- java.lang.Object
-
- org.jboss.netty.handler.codec.oneone.OneToOneDecoder
-
- org.jboss.netty.handler.codec.spdy.SpdyHttpDecoder
-
- All Implemented Interfaces:
ChannelHandler
,ChannelUpstreamHandler
public class SpdyHttpDecoder extends OneToOneDecoder
DecodesSpdySynStreamFrame
s,SpdySynReplyFrame
s, andSpdyDataFrame
s intoHttpRequest
s andHttpResponse
s.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Field Summary
Fields Modifier and Type Field Description private int
maxContentLength
private java.util.Map<java.lang.Integer,HttpMessage>
messageMap
private int
spdyVersion
-
Constructor Summary
Constructors Modifier Constructor Description SpdyHttpDecoder(SpdyVersion spdyVersion, int maxContentLength)
Creates a new instance.protected
SpdyHttpDecoder(SpdyVersion spdyVersion, int maxContentLength, java.util.Map<java.lang.Integer,HttpMessage> messageMap)
Creates a new instance with the specified parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static HttpRequest
createHttpRequest(int spdyVersion, SpdyHeadersFrame requestFrame)
private static HttpResponse
createHttpResponse(int spdyVersion, SpdyHeadersFrame responseFrame)
protected java.lang.Object
decode(ChannelHandlerContext ctx, Channel channel, java.lang.Object msg)
Transforms the specified received message into another message and return the transformed message.protected HttpMessage
getMessage(int streamId)
protected HttpMessage
putMessage(int streamId, HttpMessage message)
protected HttpMessage
removeMessage(int streamId)
-
Methods inherited from class org.jboss.netty.handler.codec.oneone.OneToOneDecoder
handleUpstream
-
-
-
-
Field Detail
-
spdyVersion
private final int spdyVersion
-
maxContentLength
private final int maxContentLength
-
messageMap
private final java.util.Map<java.lang.Integer,HttpMessage> messageMap
-
-
Constructor Detail
-
SpdyHttpDecoder
public SpdyHttpDecoder(SpdyVersion spdyVersion, int maxContentLength)
Creates a new instance.- Parameters:
spdyVersion
- 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
protected SpdyHttpDecoder(SpdyVersion spdyVersion, int maxContentLength, java.util.Map<java.lang.Integer,HttpMessage> messageMap)
Creates a new instance with the specified parameters.- Parameters:
spdyVersion
- 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.
-
-
Method Detail
-
putMessage
protected HttpMessage putMessage(int streamId, HttpMessage message)
-
getMessage
protected HttpMessage getMessage(int streamId)
-
removeMessage
protected HttpMessage removeMessage(int streamId)
-
decode
protected java.lang.Object decode(ChannelHandlerContext ctx, Channel channel, java.lang.Object msg) throws java.lang.Exception
Description copied from class:OneToOneDecoder
Transforms the specified received message into another message and return the transformed message. Returnnull
if the received message is supposed to be discarded.- Specified by:
decode
in classOneToOneDecoder
- Throws:
java.lang.Exception
-
createHttpRequest
private static HttpRequest createHttpRequest(int spdyVersion, SpdyHeadersFrame requestFrame) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createHttpResponse
private static HttpResponse createHttpResponse(int spdyVersion, SpdyHeadersFrame responseFrame) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-