Class BasicHttpServerCodec
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.ChannelDuplexHandler
-
- io.netty.channel.CombinedChannelDuplexHandler<BasicHttpRequestDecoder,io.netty.handler.codec.http.HttpResponseEncoder>
-
- com.linkedin.alpini.netty4.handlers.BasicHttpServerCodec
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler,io.netty.handler.codec.http.HttpServerUpgradeHandler.SourceCodec
public class BasicHttpServerCodec extends io.netty.channel.CombinedChannelDuplexHandler<BasicHttpRequestDecoder,io.netty.handler.codec.http.HttpResponseEncoder> implements io.netty.handler.codec.http.HttpServerUpgradeHandler.SourceCodec
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBasicHttpServerCodec.Decoderprotected classBasicHttpServerCodec.Encoderstatic classBasicHttpServerCodec.ResponseOutOfSequence
-
Constructor Summary
Constructors Constructor Description BasicHttpServerCodec()Creates a new instance with the default decoder options (maxInitialLineLength (4096},maxHeaderSize (8192), andmaxChunkSize (8192)).BasicHttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize)Creates a new instance with the specified decoder options.BasicHttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders)Creates a new instance with the specified decoder options.BasicHttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders, int initialBufferSize)Creates a new instance with the specified decoder options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BasicHttpServerCodec.DecodercreateDecoder(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders, int initialBufferSize)protected BasicHttpServerCodec.EncodercreateEncoder()protected io.netty.handler.codec.http.HttpMessagecreateInvalidMessage(long startTimeMillis, long startNanos)protected io.netty.handler.codec.http.HttpMessagecreateMessage(java.lang.String[] initialLine, boolean validateHeaders, long startTimeMillis, long startNanos)voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)voidupgradeFrom(io.netty.channel.ChannelHandlerContext ctx)Upgrades to another protocol from HTTP.-
Methods inherited from class io.netty.channel.CombinedChannelDuplexHandler
bind, channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, handlerAdded, handlerRemoved, inboundHandler, init, outboundHandler, read, removeInboundHandler, removeOutboundHandler, userEventTriggered, write
-
-
-
-
Constructor Detail
-
BasicHttpServerCodec
public BasicHttpServerCodec()
Creates a new instance with the default decoder options (maxInitialLineLength (4096},maxHeaderSize (8192), andmaxChunkSize (8192)).
-
BasicHttpServerCodec
public BasicHttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize)Creates a new instance with the specified decoder options.
-
BasicHttpServerCodec
public BasicHttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders)Creates a new instance with the specified decoder options.
-
BasicHttpServerCodec
public BasicHttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders, int initialBufferSize)Creates a new instance with the specified decoder options.
-
-
Method Detail
-
createDecoder
protected BasicHttpServerCodec.Decoder createDecoder(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders, int initialBufferSize)
-
createEncoder
protected BasicHttpServerCodec.Encoder createEncoder()
-
upgradeFrom
public void upgradeFrom(io.netty.channel.ChannelHandlerContext ctx)
Upgrades to another protocol from HTTP. Removes theBasicHttpRequestDecoderandHttpResponseEncoderfrom the pipeline.- Specified by:
upgradeFromin interfaceio.netty.handler.codec.http.HttpServerUpgradeHandler.SourceCodec
-
createMessage
protected io.netty.handler.codec.http.HttpMessage createMessage(java.lang.String[] initialLine, boolean validateHeaders, long startTimeMillis, long startNanos)
-
createInvalidMessage
protected io.netty.handler.codec.http.HttpMessage createInvalidMessage(long startTimeMillis, long startNanos)
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.CombinedChannelDuplexHandler<BasicHttpRequestDecoder,io.netty.handler.codec.http.HttpResponseEncoder>- Throws:
java.lang.Exception
-
-