Class Http3FrameToHttpObjectCodec

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler

    public final class Http3FrameToHttpObjectCodec
    extends Http3RequestStreamInboundHandler
    implements io.netty.channel.ChannelOutboundHandler
    This handler converts from Http3RequestStreamFrame to HttpObject, and back. It can be used as an adapter in conjunction with Http3ServerConnectionHandler or Http3ClientConnectionHandler to make http/3 connections backward-compatible with ChannelHandlers expecting HttpObject.

    For simplicity, it converts to chunked encoding unless the entire stream is a single header.

    • Constructor Detail

      • Http3FrameToHttpObjectCodec

        public Http3FrameToHttpObjectCodec​(boolean isServer,
                                           boolean validateHeaders)
      • Http3FrameToHttpObjectCodec

        public Http3FrameToHttpObjectCodec​(boolean isServer)
    • Method Detail

      • isSharable

        public boolean isSharable()
        Overrides:
        isSharable in class io.netty.channel.ChannelHandlerAdapter
      • write

        public void write​(io.netty.channel.ChannelHandlerContext ctx,
                          Object msg,
                          io.netty.channel.ChannelPromise promise)
                   throws Exception
        Encode from an HttpObject to an Http3RequestStreamFrame. This method will be called for each written message that can be handled by this encoder. NOTE: 100-Continue responses that are NOT FullHttpResponse will be rejected.
        Specified by:
        write in interface io.netty.channel.ChannelOutboundHandler
        Parameters:
        ctx - the ChannelHandlerContext which this handler belongs to
        msg - the HttpObject message to encode
        Throws:
        Exception - is thrown if an error occurs
      • flush

        public void flush​(io.netty.channel.ChannelHandlerContext ctx)
        Specified by:
        flush in interface io.netty.channel.ChannelOutboundHandler
      • bind

        public void bind​(io.netty.channel.ChannelHandlerContext ctx,
                         SocketAddress localAddress,
                         io.netty.channel.ChannelPromise promise)
        Specified by:
        bind in interface io.netty.channel.ChannelOutboundHandler
      • connect

        public void connect​(io.netty.channel.ChannelHandlerContext ctx,
                            SocketAddress remoteAddress,
                            SocketAddress localAddress,
                            io.netty.channel.ChannelPromise promise)
        Specified by:
        connect in interface io.netty.channel.ChannelOutboundHandler
      • disconnect

        public void disconnect​(io.netty.channel.ChannelHandlerContext ctx,
                               io.netty.channel.ChannelPromise promise)
        Specified by:
        disconnect in interface io.netty.channel.ChannelOutboundHandler
      • close

        public void close​(io.netty.channel.ChannelHandlerContext ctx,
                          io.netty.channel.ChannelPromise promise)
        Specified by:
        close in interface io.netty.channel.ChannelOutboundHandler
      • deregister

        public void deregister​(io.netty.channel.ChannelHandlerContext ctx,
                               io.netty.channel.ChannelPromise promise)
        Specified by:
        deregister in interface io.netty.channel.ChannelOutboundHandler
      • read

        public void read​(io.netty.channel.ChannelHandlerContext ctx)
                  throws Exception
        Specified by:
        read in interface io.netty.channel.ChannelOutboundHandler
        Throws:
        Exception