Home / Class/ IndexAwareQuicConnectionIdGenerator Class — netty Architecture

IndexAwareQuicConnectionIdGenerator Class — netty Architecture

Architecture documentation for the IndexAwareQuicConnectionIdGenerator class in QuicCodecDispatcher.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  af73f0d0_d169_9423_d445_124f99d0bd30["IndexAwareQuicConnectionIdGenerator"]
  a14ebc00_41a1_b954_e2ee_6cef1b775b7b["QuicCodecDispatcher.java"]
  af73f0d0_d169_9423_d445_124f99d0bd30 -->|defined in| a14ebc00_41a1_b954_e2ee_6cef1b775b7b
  0d770761_d19e_2fb6_7b6c_8a5238e729c5["IndexAwareQuicConnectionIdGenerator()"]
  af73f0d0_d169_9423_d445_124f99d0bd30 -->|method| 0d770761_d19e_2fb6_7b6c_8a5238e729c5
  a7159a21_0caf_ab44_5f7a_6ec91c6c4d49["ByteBuffer()"]
  af73f0d0_d169_9423_d445_124f99d0bd30 -->|method| a7159a21_0caf_ab44_5f7a_6ec91c6c4d49
  c0d9cf9c_6e5b_fb7c_0202_2d7a499946ec["maxConnectionIdLength()"]
  af73f0d0_d169_9423_d445_124f99d0bd30 -->|method| c0d9cf9c_6e5b_fb7c_0202_2d7a499946ec
  9a6191f7_32be_6ec5_a2f9_ac906b72fa24["isIdempotent()"]
  af73f0d0_d169_9423_d445_124f99d0bd30 -->|method| 9a6191f7_32be_6ec5_a2f9_ac906b72fa24

Relationship Graph

Source Code

codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicCodecDispatcher.java lines 257–300

    private static final class IndexAwareQuicConnectionIdGenerator implements QuicConnectionIdGenerator {
        private final int idx;
        private final QuicConnectionIdGenerator idGenerator;

        IndexAwareQuicConnectionIdGenerator(int idx, QuicConnectionIdGenerator idGenerator) {
            this.idx = idx;
            this.idGenerator = idGenerator;
        }

        @Override
        public ByteBuffer newId(int length) {
            if (length > Short.BYTES) {
                return encodeIdx(idGenerator.newId(length - Short.BYTES), idx);
            }
            return idGenerator.newId(length);
        }

        @Override
        public ByteBuffer newId(ByteBuffer input, int length) {
            if (length > Short.BYTES) {
                return encodeIdx(idGenerator.newId(input, length - Short.BYTES), idx);
            }
            return idGenerator.newId(input, length);
        }

        @Override
        public ByteBuffer newId(ByteBuffer scid, ByteBuffer dcid, int length) {
            if (length > Short.BYTES) {
                return encodeIdx(idGenerator.newId(scid, dcid, length - Short.BYTES), idx);
            }
            return idGenerator.newId(scid, dcid, length);
        }

        @Override
        public int maxConnectionIdLength() {
            return idGenerator.maxConnectionIdLength();
        }

        @Override
        public boolean isIdempotent() {
            // Return false as the id might be different because of the idx that is encoded into it.
            return false;
        }
    }

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free