Interface QuicConnectionIdGenerator


  • public interface QuicConnectionIdGenerator
    Creates new connection id instances.
    • Method Detail

      • newId

        java.nio.ByteBuffer newId​(int length)
        Creates a new connection id with the given length. This method may not be supported by a sign id generator implementation as a sign id generator should always have an input to sign with, otherwise this method may generate the same id which may cause some unpredictable issues when we use it.
        Parameters:
        length - the length of the id.
        Returns:
        the id.
      • newId

        java.nio.ByteBuffer newId​(java.nio.ByteBuffer input,
                                  int length)
        Creates a new connection id with the given length. The given input may be used to sign or seed the id, or may be ignored (depending on the implementation).
        Parameters:
        input - the input which may be used to generate the id.
        length - the length of the id.
        Returns:
        the id.
      • newId

        default java.nio.ByteBuffer newId​(java.nio.ByteBuffer scid,
                                          java.nio.ByteBuffer dcid,
                                          int length)
        Creates a new connection id with the given length. The given source connection id and destionation connection id may be used to sign or seed the id, or may be ignored (depending on the implementation).
        Parameters:
        scid - the source connection id which may be used to generate the id.
        dcid - the destination connection id which may be used to generate the id.
        length - the length of the id.
        Returns:
        the id.
      • maxConnectionIdLength

        int maxConnectionIdLength()
        Returns the maximum length of a connection id.
        Returns:
        the maximum length of a connection id that is supported.
      • isIdempotent

        boolean isIdempotent()
        Returns true if the implementation is idempotent, which means we will get the same id with the same input ByteBuffer. Otherwise, returns false.
        Returns:
        whether the implementation is idempotent.