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 class 
     
    protected class 
     
    static class 
     

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance with the default decoder options (maxInitialLineLength (4096}, maxHeaderSize (8192), and maxChunkSize (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 Type
    Method
    Description
    createDecoder(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders, int initialBufferSize)
     
     
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BasicHttpServerCodec

      public BasicHttpServerCodec()
      Creates a new instance with the default decoder options (maxInitialLineLength (4096}, maxHeaderSize (8192), and maxChunkSize (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

      protected BasicHttpServerCodec.Encoder createEncoder()
    • upgradeFrom

      public void upgradeFrom(io.netty.channel.ChannelHandlerContext ctx)
      Upgrades to another protocol from HTTP. Removes the BasicHttpRequestDecoder and HttpResponseEncoder from the pipeline.
      Specified by:
      upgradeFrom in interface io.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 interface io.netty.channel.ChannelHandler
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      exceptionCaught in class io.netty.channel.CombinedChannelDuplexHandler<BasicHttpRequestDecoder,io.netty.handler.codec.http.HttpResponseEncoder>
      Throws:
      Exception