Home / Class/ Http2ServerUpgradeCodec Class — netty Architecture

Http2ServerUpgradeCodec Class — netty Architecture

Architecture documentation for the Http2ServerUpgradeCodec class in Http2ServerUpgradeCodec.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c35ffca0_c07b_0afb_4806_c07fa100b346["Http2ServerUpgradeCodec"]
  4c85c644_63b9_4488_dbba_953061f151cb["Http2ServerUpgradeCodec.java"]
  c35ffca0_c07b_0afb_4806_c07fa100b346 -->|defined in| 4c85c644_63b9_4488_dbba_953061f151cb
  afc90898_bf67_445a_eebd_3d45c65f2d5d["Http2ServerUpgradeCodec()"]
  c35ffca0_c07b_0afb_4806_c07fa100b346 -->|method| afc90898_bf67_445a_eebd_3d45c65f2d5d
  7bbc9441_55fe_52b3_5c51_0de941bd3104["requiredUpgradeHeaders()"]
  c35ffca0_c07b_0afb_4806_c07fa100b346 -->|method| 7bbc9441_55fe_52b3_5c51_0de941bd3104
  eed9fa45_5d9e_f815_4e1b_00c4eca7ddaf["prepareUpgradeResponse()"]
  c35ffca0_c07b_0afb_4806_c07fa100b346 -->|method| eed9fa45_5d9e_f815_4e1b_00c4eca7ddaf
  59d2ef2e_aa4e_5acf_1d4f_f8f8f720e695["upgradeTo()"]
  c35ffca0_c07b_0afb_4806_c07fa100b346 -->|method| 59d2ef2e_aa4e_5acf_1d4f_f8f8f720e695
  70c7a352_20d5_15d1_e9e4_c35555e171e9["Http2Settings()"]
  c35ffca0_c07b_0afb_4806_c07fa100b346 -->|method| 70c7a352_20d5_15d1_e9e4_c35555e171e9
  b2043bca_3d96_32b4_57f2_34c736dab89a["ByteBuf()"]
  c35ffca0_c07b_0afb_4806_c07fa100b346 -->|method| b2043bca_3d96_32b4_57f2_34c736dab89a

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java lines 43–211

public class Http2ServerUpgradeCodec implements HttpServerUpgradeHandler.UpgradeCodec {

    private static final InternalLogger logger = InternalLoggerFactory.getInstance(Http2ServerUpgradeCodec.class);
    private static final List<CharSequence> REQUIRED_UPGRADE_HEADERS =
            Collections.singletonList(HTTP_UPGRADE_SETTINGS_HEADER);
    private static final ChannelHandler[] EMPTY_HANDLERS = new ChannelHandler[0];

    private final String handlerName;
    private final Http2ConnectionHandler connectionHandler;
    private final ChannelHandler[] handlers;
    private final Http2FrameReader frameReader;

    private Http2Settings settings;

    /**
     * Creates the codec using a default name for the connection handler when adding to the
     * pipeline.
     *
     * @param connectionHandler the HTTP/2 connection handler
     */
    public Http2ServerUpgradeCodec(Http2ConnectionHandler connectionHandler) {
        this(null, connectionHandler, EMPTY_HANDLERS);
    }

    /**
     * Creates the codec using a default name for the connection handler when adding to the
     * pipeline.
     *
     * @param http2Codec the HTTP/2 multiplexing handler.
     */
    public Http2ServerUpgradeCodec(Http2MultiplexCodec http2Codec) {
        this(null, http2Codec, EMPTY_HANDLERS);
    }

    /**
     * Creates the codec providing an upgrade to the given handler for HTTP/2.
     *
     * @param handlerName the name of the HTTP/2 connection handler to be used in the pipeline,
     *                    or {@code null} to auto-generate the name
     * @param connectionHandler the HTTP/2 connection handler
     */
    public Http2ServerUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler) {
        this(handlerName, connectionHandler, EMPTY_HANDLERS);
    }

    /**
     * Creates the codec providing an upgrade to the given handler for HTTP/2.
     *
     * @param handlerName the name of the HTTP/2 connection handler to be used in the pipeline.
     * @param http2Codec the HTTP/2 multiplexing handler.
     */
    public Http2ServerUpgradeCodec(String handlerName, Http2MultiplexCodec http2Codec) {
        this(handlerName, http2Codec, EMPTY_HANDLERS);
    }

    /**
     * Creates the codec using a default name for the connection handler when adding to the
     * pipeline.
     *
     * @param http2Codec the HTTP/2 frame handler.
     * @param handlers the handlers that will handle the {@link Http2Frame}s.
     */
    public Http2ServerUpgradeCodec(Http2FrameCodec http2Codec, ChannelHandler... handlers) {
        this(null, http2Codec, handlers);
    }

    public Http2ServerUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler,
            ChannelHandler... handlers) {
        this.handlerName = handlerName;
        this.connectionHandler = connectionHandler;
        this.handlers = handlers;
        frameReader = new DefaultHttp2FrameReader();
    }

    @Override
    public Collection<CharSequence> requiredUpgradeHeaders() {
        return REQUIRED_UPGRADE_HEADERS;
    }

    @Override
    public boolean prepareUpgradeResponse(ChannelHandlerContext ctx, FullHttpRequest upgradeRequest,

Frequently Asked Questions

What is the Http2ServerUpgradeCodec class?
Http2ServerUpgradeCodec is a class in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java.
Where is Http2ServerUpgradeCodec defined?
Http2ServerUpgradeCodec is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java at line 43.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free