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
Modifier and TypeClassDescriptionprotected class
protected class
static class
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Constructor Summary
ConstructorDescriptionCreates 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.Decoder
createDecoder
(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders, int initialBufferSize) protected BasicHttpServerCodec.Encoder
protected io.netty.handler.codec.http.HttpMessage
createInvalidMessage
(long startTimeMillis, long startNanos) protected io.netty.handler.codec.http.HttpMessage
createMessage
(String[] initialLine, boolean validateHeaders, long startTimeMillis, long startNanos) void
exceptionCaught
(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) void
upgradeFrom
(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
Methods 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 theBasicHttpRequestDecoder
andHttpResponseEncoder
from the pipeline.- Specified by:
upgradeFrom
in 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:
exceptionCaught
in interfaceio.netty.channel.ChannelHandler
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
exceptionCaught
in classio.netty.channel.CombinedChannelDuplexHandler<BasicHttpRequestDecoder,
io.netty.handler.codec.http.HttpResponseEncoder> - Throws:
Exception
-