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:
ChannelHandler, ChannelInboundHandler
Decodes
SpdySynStreamFrames, SpdySynReplyFrames,
and SpdyDataFrames into FullHttpRequests and FullHttpResponses.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Constructor Summary
ConstructorsModifierConstructorDescriptionSpdyHttpDecoder(SpdyVersion version, int maxContentLength) Creates a new instance.SpdyHttpDecoder(SpdyVersion version, int maxContentLength, boolean validateHeaders) Deprecated.protectedSpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer, FullHttpMessage> messageMap) Creates a new instance with the specified parameters.protectedSpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer, FullHttpMessage> messageMap, boolean validateHeaders) Deprecated.Use theSpdyHttpDecoder(SpdyVersion, int, Map, HttpHeadersFactory, HttpHeadersFactory)constructor instead.protectedSpdyHttpDecoder(SpdyVersion version, int maxContentLength, Map<Integer, FullHttpMessage> messageMap, HttpHeadersFactory headersFactory, HttpHeadersFactory trailersFactory) Creates a new instance with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidCallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline.protected voiddecode(ChannelHandlerContext ctx, SpdyFrame msg, List<Object> out) Decode from one message to an other.protected FullHttpMessagegetMessage(int streamId) protected FullHttpMessageputMessage(int streamId, FullHttpMessage message) protected FullHttpMessageremoveMessage(int streamId) Methods inherited from class MessageToMessageDecoder
acceptInboundMessage, channelRead, channelReadCompleteMethods inherited from class ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
SpdyHttpDecoder
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, aTooLongFrameExceptionwill 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, aTooLongFrameExceptionwill be raised.validateHeaders-trueif 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, aTooLongFrameExceptionwill be raised.messageMap- theMapused 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, aTooLongFrameExceptionwill be raised.messageMap- theMapused to hold partially received messages.validateHeaders-trueif 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, aTooLongFrameExceptionwill be raised.messageMap- theMapused to hold partially received messages.headersFactory- The factory used for creating HTTP headerstrailersFactory- The factory used for creating HTTP trailers.
-
-
Method Details
-
channelInactive
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
channelInactivein interfaceChannelInboundHandler- Overrides:
channelInactivein classChannelInboundHandlerAdapter- Throws:
Exception
-
putMessage
-
getMessage
-
removeMessage
-
decode
Description copied from class:MessageToMessageDecoderDecode from one message to an other. This method will be called for each written message that can be handled by this decoder.- Specified by:
decodein classMessageToMessageDecoder<SpdyFrame>- Parameters:
ctx- theChannelHandlerContextwhich thisMessageToMessageDecoderbelongs tomsg- the message to decode to an other oneout- theListto which decoded messages should be added- Throws:
Exception- is thrown if an error occurs
-
SpdyHttpDecoder(SpdyVersion, int, Map, HttpHeadersFactory, HttpHeadersFactory)constructor instead.