public class SpdyHttpDecoder extends MessageToMessageDecoder<SpdyFrame>
SpdySynStreamFrames, SpdySynReplyFrames,
and SpdyDataFrames into FullHttpRequests and FullHttpResponses.ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private int |
maxContentLength |
private java.util.Map<java.lang.Integer,FullHttpMessage> |
messageMap |
private int |
spdyVersion |
private boolean |
validateHeaders |
| Modifier | Constructor and Description |
|---|---|
|
SpdyHttpDecoder(SpdyVersion version,
int maxContentLength)
Creates a new instance.
|
|
SpdyHttpDecoder(SpdyVersion version,
int maxContentLength,
boolean validateHeaders)
Creates a new instance.
|
protected |
SpdyHttpDecoder(SpdyVersion version,
int maxContentLength,
java.util.Map<java.lang.Integer,FullHttpMessage> messageMap)
Creates a new instance with the specified parameters.
|
protected |
SpdyHttpDecoder(SpdyVersion version,
int maxContentLength,
java.util.Map<java.lang.Integer,FullHttpMessage> messageMap,
boolean validateHeaders)
Creates a new instance with the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
channelInactive(ChannelHandlerContext ctx)
Calls
ChannelHandlerContext.fireChannelInactive() to forward
to the next ChannelInboundHandler in the ChannelPipeline. |
private static FullHttpRequest |
createHttpRequest(SpdyHeadersFrame requestFrame,
ByteBufAllocator alloc) |
private static FullHttpResponse |
createHttpResponse(SpdyHeadersFrame responseFrame,
ByteBufAllocator alloc,
boolean validateHeaders) |
protected void |
decode(ChannelHandlerContext ctx,
SpdyFrame msg,
java.util.List<java.lang.Object> out)
Decode from one message to an other.
|
protected FullHttpMessage |
getMessage(int streamId) |
protected FullHttpMessage |
putMessage(int streamId,
FullHttpMessage message) |
protected FullHttpMessage |
removeMessage(int streamId) |
acceptInboundMessage, channelReadchannelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAdded, handlerRemovedprivate final boolean validateHeaders
private final int spdyVersion
private final int maxContentLength
private final java.util.Map<java.lang.Integer,FullHttpMessage> messageMap
public SpdyHttpDecoder(SpdyVersion version, int maxContentLength)
version - 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.public SpdyHttpDecoder(SpdyVersion version, int maxContentLength, boolean validateHeaders)
version - 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.validateHeaders - true if http headers should be validatedprotected SpdyHttpDecoder(SpdyVersion version, int maxContentLength, java.util.Map<java.lang.Integer,FullHttpMessage> messageMap)
version - 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 SpdyHttpDecoder(SpdyVersion version, int maxContentLength, java.util.Map<java.lang.Integer,FullHttpMessage> messageMap, boolean validateHeaders)
version - 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.validateHeaders - true if http headers should be validatedpublic void channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelInactive() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelInactive in interface ChannelInboundHandlerchannelInactive in class ChannelInboundHandlerAdapterjava.lang.Exceptionprotected FullHttpMessage putMessage(int streamId, FullHttpMessage message)
protected FullHttpMessage getMessage(int streamId)
protected FullHttpMessage removeMessage(int streamId)
protected void decode(ChannelHandlerContext ctx, SpdyFrame msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageDecoderdecode in class MessageToMessageDecoder<SpdyFrame>ctx - the ChannelHandlerContext which this MessageToMessageDecoder belongs tomsg - the message to decode to an other oneout - the List to which decoded messages should be addedjava.lang.Exception - is thrown if an error occursprivate static FullHttpRequest createHttpRequest(SpdyHeadersFrame requestFrame, ByteBufAllocator alloc) throws java.lang.Exception
java.lang.Exceptionprivate static FullHttpResponse createHttpResponse(SpdyHeadersFrame responseFrame, ByteBufAllocator alloc, boolean validateHeaders) throws java.lang.Exception
java.lang.Exception