public class SpdyHttpDecoder extends OneToOneDecoder
SpdySynStreamFrames, SpdySynReplyFrames,
and SpdyDataFrames into HttpRequests and HttpResponses.ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private int |
maxContentLength |
private java.util.Map<java.lang.Integer,HttpMessage> |
messageMap |
private int |
spdyVersion |
| Modifier | Constructor and 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.
|
| Modifier and Type | Method and 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) |
handleUpstreamprivate final int spdyVersion
private final int maxContentLength
private final java.util.Map<java.lang.Integer,HttpMessage> messageMap
public SpdyHttpDecoder(SpdyVersion spdyVersion, int maxContentLength)
spdyVersion - the protocol versionmaxContentLength - the maximum length of the message content.
If the length of the message content exceeds this value,
a TooLongFrameException will be raised.protected SpdyHttpDecoder(SpdyVersion spdyVersion, int maxContentLength, java.util.Map<java.lang.Integer,HttpMessage> messageMap)
spdyVersion - the protocol versionmaxContentLength - the maximum length of the message content.
If the length of the message content exceeds this value,
a TooLongFrameException will be raised.messageMap - the Map used to hold partially received messages.protected HttpMessage putMessage(int streamId, HttpMessage message)
protected HttpMessage getMessage(int streamId)
protected HttpMessage removeMessage(int streamId)
protected java.lang.Object decode(ChannelHandlerContext ctx, Channel channel, java.lang.Object msg) throws java.lang.Exception
OneToOneDecodernull if the received message
is supposed to be discarded.decode in class OneToOneDecoderjava.lang.Exceptionprivate static HttpRequest createHttpRequest(int spdyVersion, SpdyHeadersFrame requestFrame) throws java.lang.Exception
java.lang.Exceptionprivate static HttpResponse createHttpResponse(int spdyVersion, SpdyHeadersFrame responseFrame) throws java.lang.Exception
java.lang.Exception