Class AbstractHttp2StreamFrameCodec

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler
    Direct Known Subclasses:
    Http2StreamFrameClientCodec, Http2StreamFrameServerCodec

    public abstract class AbstractHttp2StreamFrameCodec
    extends io.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http2.Http2StreamFrame,​io.netty.handler.codec.http.HttpObject>
    A copy of the netty Http2StreamFrameToHttpObjectCodec except with the methods which actually return the converted objects have been made abstract.
    • Nested Class Summary

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

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

      Fields 
      Modifier and Type Field Description
      protected static java.util.List<io.netty.util.AsciiString> HTTP_TO_HTTP2_HEADER_DENY_LIST
      The set of headers that should not be directly copied when converting headers from HTTP to HTTP/2.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean acceptInboundMessage​(java.lang.Object msg)  
      protected static io.netty.channel.Channel connectionChannel​(io.netty.channel.ChannelHandlerContext ctx)  
      protected static io.netty.handler.codec.http.HttpScheme connectionScheme​(io.netty.channel.ChannelHandlerContext ctx)  
      protected static io.netty.util.Attribute<io.netty.handler.codec.http.HttpScheme> connectionSchemeAttribute​(io.netty.channel.ChannelHandlerContext ctx)  
      protected void decode​(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http2.Http2StreamFrame frame, java.util.List<java.lang.Object> out)  
      protected void encode​(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpObject obj, java.util.List<java.lang.Object> out)
      Encode from an HttpObject to an Http2StreamFrame.
      void handlerAdded​(io.netty.channel.ChannelHandlerContext ctx)  
      protected boolean isSsl​(io.netty.channel.ChannelHandlerContext ctx)  
      protected abstract io.netty.handler.codec.http.FullHttpMessage newFullMessage​(int id, io.netty.handler.codec.http2.Http2Headers headers, boolean validateHeaders, io.netty.buffer.ByteBufAllocator alloc)  
      protected abstract io.netty.handler.codec.http.HttpMessage newMessage​(int id, io.netty.handler.codec.http2.Http2Headers headers, boolean validateHeaders)  
      protected abstract io.netty.handler.codec.http2.Http2Headers toHttp2Headers​(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage msg, boolean validateHeaders)  
      • Methods inherited from class io.netty.handler.codec.MessageToMessageCodec

        acceptOutboundMessage, channelRead, write
      • Methods inherited from class io.netty.channel.ChannelDuplexHandler

        bind, close, connect, deregister, disconnect, flush, read
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerRemoved, isSharable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerRemoved
    • Field Detail

      • HTTP_TO_HTTP2_HEADER_DENY_LIST

        protected static final java.util.List<io.netty.util.AsciiString> HTTP_TO_HTTP2_HEADER_DENY_LIST
        The set of headers that should not be directly copied when converting headers from HTTP to HTTP/2.
    • Constructor Detail

      • AbstractHttp2StreamFrameCodec

        protected AbstractHttp2StreamFrameCodec​(boolean validateHeaders)
    • Method Detail

      • acceptInboundMessage

        public boolean acceptInboundMessage​(java.lang.Object msg)
                                     throws java.lang.Exception
        Overrides:
        acceptInboundMessage in class io.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http2.Http2StreamFrame,​io.netty.handler.codec.http.HttpObject>
        Throws:
        java.lang.Exception
      • decode

        protected void decode​(io.netty.channel.ChannelHandlerContext ctx,
                              io.netty.handler.codec.http2.Http2StreamFrame frame,
                              java.util.List<java.lang.Object> out)
                       throws java.lang.Exception
        Specified by:
        decode in class io.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http2.Http2StreamFrame,​io.netty.handler.codec.http.HttpObject>
        Throws:
        java.lang.Exception
      • encode

        protected void encode​(io.netty.channel.ChannelHandlerContext ctx,
                              io.netty.handler.codec.http.HttpObject obj,
                              java.util.List<java.lang.Object> out)
                       throws java.lang.Exception
        Encode from an HttpObject to an Http2StreamFrame. 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:
        encode in class io.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http2.Http2StreamFrame,​io.netty.handler.codec.http.HttpObject>
        Parameters:
        ctx - the ChannelHandlerContext which this handler belongs to
        obj - the HttpObject message to encode
        out - the List into which the encoded msg should be added needs to do some kind of aggregation
        Throws:
        java.lang.Exception - is thrown if an error occurs
      • toHttp2Headers

        protected abstract io.netty.handler.codec.http2.Http2Headers toHttp2Headers​(io.netty.channel.ChannelHandlerContext ctx,
                                                                                    io.netty.handler.codec.http.HttpMessage msg,
                                                                                    boolean validateHeaders)
                                                                             throws io.netty.handler.codec.http2.Http2Exception
        Throws:
        io.netty.handler.codec.http2.Http2Exception
      • newMessage

        protected abstract io.netty.handler.codec.http.HttpMessage newMessage​(int id,
                                                                              io.netty.handler.codec.http2.Http2Headers headers,
                                                                              boolean validateHeaders)
                                                                       throws io.netty.handler.codec.http2.Http2Exception
        Throws:
        io.netty.handler.codec.http2.Http2Exception
      • newFullMessage

        protected abstract io.netty.handler.codec.http.FullHttpMessage newFullMessage​(int id,
                                                                                      io.netty.handler.codec.http2.Http2Headers headers,
                                                                                      boolean validateHeaders,
                                                                                      io.netty.buffer.ByteBufAllocator alloc)
                                                                               throws io.netty.handler.codec.http2.Http2Exception
        Throws:
        io.netty.handler.codec.http2.Http2Exception
      • handlerAdded

        public void handlerAdded​(io.netty.channel.ChannelHandlerContext ctx)
                          throws java.lang.Exception
        Specified by:
        handlerAdded in interface io.netty.channel.ChannelHandler
        Overrides:
        handlerAdded in class io.netty.channel.ChannelHandlerAdapter
        Throws:
        java.lang.Exception
      • isSsl

        protected boolean isSsl​(io.netty.channel.ChannelHandlerContext ctx)
      • connectionScheme

        protected static io.netty.handler.codec.http.HttpScheme connectionScheme​(io.netty.channel.ChannelHandlerContext ctx)
      • connectionSchemeAttribute

        protected static io.netty.util.Attribute<io.netty.handler.codec.http.HttpScheme> connectionSchemeAttribute​(io.netty.channel.ChannelHandlerContext ctx)
      • connectionChannel

        protected static io.netty.channel.Channel connectionChannel​(io.netty.channel.ChannelHandlerContext ctx)