Class SpdyHttpDecoder
java.lang.Object
org.jboss.netty.handler.codec.oneone.OneToOneDecoder
org.jboss.netty.handler.codec.spdy.SpdyHttpDecoder
- All Implemented Interfaces:
ChannelHandler
,ChannelUpstreamHandler
Decodes
SpdySynStreamFrame
s, SpdySynReplyFrame
s,
and SpdyDataFrame
s into HttpRequest
s and HttpResponse
s.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final Map<Integer,
HttpMessage> private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionSpdyHttpDecoder
(SpdyVersion spdyVersion, int maxContentLength) Creates a new instance.protected
SpdyHttpDecoder
(SpdyVersion spdyVersion, int maxContentLength, Map<Integer, HttpMessage> messageMap) Creates a new instance with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionprivate static HttpRequest
createHttpRequest
(int spdyVersion, SpdyHeadersFrame requestFrame) private static HttpResponse
createHttpResponse
(int spdyVersion, SpdyHeadersFrame responseFrame) protected Object
decode
(ChannelHandlerContext ctx, Channel channel, 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 Details
-
spdyVersion
private final int spdyVersion -
maxContentLength
private final int maxContentLength -
messageMap
-
-
Constructor Details
-
SpdyHttpDecoder
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, Map<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 Details
-
putMessage
-
getMessage
-
removeMessage
-
decode
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:
Exception
-
createHttpRequest
private static HttpRequest createHttpRequest(int spdyVersion, SpdyHeadersFrame requestFrame) throws Exception - Throws:
Exception
-
createHttpResponse
private static HttpResponse createHttpResponse(int spdyVersion, SpdyHeadersFrame responseFrame) throws Exception - Throws:
Exception
-