Home / Class/ QuicServerCodecBuilder Class — netty Architecture

QuicServerCodecBuilder Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  37bf87d6_92e6_c135_03ed_b42568e3d319["QuicServerCodecBuilder"]
  7c625147_4d46_eb9d_1a86_ba14d0b0bbc5["QuicServerCodecBuilder.java"]
  37bf87d6_92e6_c135_03ed_b42568e3d319 -->|defined in| 7c625147_4d46_eb9d_1a86_ba14d0b0bbc5
  b914dc6f_2df0_e73b_9d23_a0a3a15d4e07["QuicServerCodecBuilder()"]
  37bf87d6_92e6_c135_03ed_b42568e3d319 -->|method| b914dc6f_2df0_e73b_9d23_a0a3a15d4e07
  88917a36_4d3c_36d0_7338_11770fe0dc8e["validate()"]
  37bf87d6_92e6_c135_03ed_b42568e3d319 -->|method| 88917a36_4d3c_36d0_7338_11770fe0dc8e
  00e0db2a_621f_bb03_c3f9_1778ba0f0c36["ChannelHandler()"]
  37bf87d6_92e6_c135_03ed_b42568e3d319 -->|method| 00e0db2a_621f_bb03_c3f9_1778ba0f0c36

Relationship Graph

Source Code

codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicServerCodecBuilder.java lines 34–223

public final class QuicServerCodecBuilder extends QuicCodecBuilder<QuicServerCodecBuilder> {
    // The order in which ChannelOptions are applied is important they may depend on each other for validation
    // purposes.
    private final Map<ChannelOption<?>, Object> options = new LinkedHashMap<>();
    private final Map<AttributeKey<?>, Object> attrs = new HashMap<>();
    private final Map<ChannelOption<?>, Object> streamOptions = new LinkedHashMap<>();
    private final Map<AttributeKey<?>, Object> streamAttrs = new HashMap<>();
    private ChannelHandler handler;
    private ChannelHandler streamHandler;
    private QuicConnectionIdGenerator connectionIdAddressGenerator;
    private QuicTokenHandler tokenHandler;
    private QuicResetTokenGenerator resetTokenGenerator;

    /**
     * Creates a new instance.
     */
    public QuicServerCodecBuilder() {
        super(true);
    }

    private QuicServerCodecBuilder(QuicServerCodecBuilder builder) {
        super(builder);
        options.putAll(builder.options);
        attrs.putAll(builder.attrs);
        streamOptions.putAll(builder.streamOptions);
        streamAttrs.putAll(builder.streamAttrs);
        handler = builder.handler;
        streamHandler = builder.streamHandler;
        connectionIdAddressGenerator = builder.connectionIdAddressGenerator;
        tokenHandler = builder.tokenHandler;
        resetTokenGenerator = builder.resetTokenGenerator;
    }

    @Override
    public QuicServerCodecBuilder clone() {
        return new QuicServerCodecBuilder(this);
    }

    /**
     * Allow to specify a {@link ChannelOption} which is used for the {@link QuicChannel} instances once they got
     * created. Use a value of {@code null} to remove a previous set {@link ChannelOption}.
     *
     * @param option    the {@link ChannelOption} to apply to the {@link QuicChannel}.
     * @param value     the value of the option.
     * @param <T>       the type of the value.
     * @return          this instance.
     */
    public <T> QuicServerCodecBuilder option(ChannelOption<T> option, @Nullable T value) {
        Quic.updateOptions(options, option, value);
        return self();
    }

    /**
     * Allow to specify an initial attribute of the newly created {@link QuicChannel}.  If the {@code value} is
     * {@code null}, the attribute of the specified {@code key} is removed.
     *
     * @param key       the {@link AttributeKey} to apply to the {@link QuicChannel}.
     * @param value     the value of the attribute.
     * @param <T>       the type of the value.
     * @return          this instance.
     */
    public <T> QuicServerCodecBuilder attr(AttributeKey<T> key, @Nullable T value) {
        Quic.updateAttributes(attrs, key, value);
        return self();
    }

    /**
     * Set the {@link ChannelHandler} that is added to the {@link io.netty.channel.ChannelPipeline} of the
     * {@link QuicChannel} once created.
     *
     * @param handler   the {@link ChannelHandler} that is added to the {@link QuicChannel}s
     *                  {@link io.netty.channel.ChannelPipeline}.
     * @return          this instance.
     */
    public QuicServerCodecBuilder handler(ChannelHandler handler) {
        this.handler = ObjectUtil.checkNotNull(handler, "handler");
        return self();
    }

    /**
     * Allow to specify a {@link ChannelOption} which is used for the {@link QuicStreamChannel} instances once they got

Frequently Asked Questions

What is the QuicServerCodecBuilder class?
QuicServerCodecBuilder is a class in the netty codebase, defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicServerCodecBuilder.java.
Where is QuicServerCodecBuilder defined?
QuicServerCodecBuilder is defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicServerCodecBuilder.java at line 34.

Analyze Your Own Codebase

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

Try Supermodel Free