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 ClassesModifier and TypeClassDescriptionprotected classprotected classstatic classNested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptionprotected BasicHttpServerCodec.DecodercreateDecoder(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders, int initialBufferSize) protected BasicHttpServerCodec.Encoderprotected io.netty.handler.codec.http.HttpMessagecreateInvalidMessage(long startTimeMillis, long startNanos) protected io.netty.handler.codec.http.HttpMessagecreateMessage(String[] initialLine, boolean validateHeaders, long startTimeMillis, long startNanos) voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, 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, writeMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Constructor Details
-
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 Details
-
createDecoder
protected BasicHttpServerCodec.Decoder createDecoder(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders, int initialBufferSize) -
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(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, Throwable cause) throws 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:
Exception
-