APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.net.http.quic

pack-priv final Class PeerConnIdManager

extends Object
Class Inheritance
Imports
java.nio.ByteBuffer, java.util.ArrayDeque, .Collections, .Iterator, .List, .Map, .NavigableMap, .NavigableSet, .Queue, .TreeMap, .TreeSet, java.util.concurrent.locks.ReentrantLock, jdk.internal.net.http.common.Log, .Logger, .Utils, jdk.internal.net.http.quic.frames.NewConnectionIDFrame, .QuicFrame, .RetireConnectionIDFrame, jdk.internal.net.http.quic.packets.InitialPacket, jdk.internal.net.quic.QuicTLSEngine, .QuicTransportErrors, .QuicTransportException

Manages the connection ids advertised by a peer of a connection. - Handles incoming NEW_CONNECTION_ID frames, - produces outgoing RETIRE_CONNECTION_ID frames, - registers received stateless reset tokens with the QuicEndpoint Additionally on the client side: - handles incoming transport parameters (preferred_address, stateless_reset_token) - stores original and retry peer IDs

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private QuicConnectionId
private long
private QuicConnectionId
private boolean
private final QuicConnectionImpl
private final Logger
private final NavigableSet<Long>
private final boolean
private volatile long
private volatile long
private final ReentrantLock
private final String
private final NavigableMap<Long, PeerConnectionId>
private QuicConnectionId
private volatile PeerConnIdManager.State
private final Queue<Long>

Constructor Summary

AccessConstructor and Description
pack-priv
PeerConnIdManager(final QuicConnectionImpl connection, final String dbTag)

Method Summary

Modifier and TypeMethod and Description
public List<byte[]>

Returns:

the list of stateless reset tokens associated with active peer connection IDs
activeResetTokens
()

Returns the list of stateless reset tokens associated with active peer connection IDs.

public void
pack-priv void
finalizeHandshakePeerConnId(final InitialPacket
the INITIAL packet from the peer
initialPacket
)

The peer in its INITIAL packet would have sent a connection id representing itself.

pack-priv QuicConnectionId

Returns:

the active peer connection ID
getPeerConnId
()

Returns the active peer connection ID.

private QuicConnectionId
getPeerConnId(final long sequenceNum)

pack-priv void
handleNewConnectionIdFrame(final NewConnectionIDFrame
the NEW_CONNECTION_ID frame
newCid
)

Process the incoming NEW_CONNECTION_ID frame.

pack-priv void
handlePreferredAddress(final ByteBuffer
preferred connection ID
preferredConnId
,
final byte[]
preferred stateless reset token
preferredStatelessResetToken
)

Save the connection ID from the preferred address QUIC transport parameter

pack-priv void
handshakeStatelessResetToken(final byte[]
stateless reset token
statelessResetToken
)

Save the stateless reset token QUIC transport parameter

private void
insertGaps(long sequenceNumber)

public QuicFrame

Returns:

a RetireConnectionIdFrame, or null if none is queued or remaining is too low
nextFrame
(int
bytes remaining in the packet
remaining
)

Produce a queued RETIRE_CONNECTION_ID frame, if it fits in the packet

pack-priv void
originalServerConnId(final QuicConnectionId
the client-selected original server connection ID
peerConnId
)

Save the client-selected original server connection ID

pack-priv QuicConnectionId

Returns:

the client-selected original server connection ID
originalServerConnId
()

Returns the client-selected original server connection ID.

private void
retirePriorTo(final long priorTo)

pack-priv void
retryConnId(final QuicConnectionId
the server-selected retry connection ID
peerConnId
)

Save the server-selected retry connection ID

pack-priv QuicConnectionId

Returns:

the connection id sent in the server's retry packet
retryConnId
()

Returns the connectionId the server included in the Source Connection ID field of a Retry packet.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

activeConnIdback to summary
private QuicConnectionId activeConnId
activeConnIdSeqback to summary
private long activeConnIdSeq
clientSelectedDestConnIdback to summary
private QuicConnectionId clientSelectedDestConnId
closedback to summary
private boolean closed
connectionback to summary
private final QuicConnectionImpl connection
debugback to summary
private final Logger debug
gapsback to summary
private final NavigableSet<Long> gaps
isClientback to summary
private final boolean isClient
largestReceivedRetirePriorToback to summary
private volatile long largestReceivedRetirePriorTo
largestReceivedSequenceNumberback to summary
private volatile long largestReceivedSequenceNumber
lockback to summary
private final ReentrantLock lock
logTagback to summary
private final String logTag
peerConnectionIdsback to summary
private final NavigableMap<Long, PeerConnectionId> peerConnectionIds
peerDecidedRetryConnIdback to summary
private QuicConnectionId peerDecidedRetryConnId
stateback to summary
private volatile PeerConnIdManager.State state
toRetireback to summary
private final Queue<Long> toRetire

Constructor Detail

PeerConnIdManagerback to summary
pack-priv PeerConnIdManager(final QuicConnectionImpl connection, final String dbTag)

Method Detail

activeResetTokensback to summary
public List<byte[]> activeResetTokens()

Returns the list of stateless reset tokens associated with active peer connection IDs.

Returns:List<byte[]>

the list of stateless reset tokens associated with active peer connection IDs

closeback to summary
public void close()
finalizeHandshakePeerConnIdback to summary
pack-priv void finalizeHandshakePeerConnId(final InitialPacket initialPacket) throws QuicTransportException

The peer in its INITIAL packet would have sent a connection id representing itself. That connection id may not be the same that we might have sent in the INITIAL packet. If it isn't the same, then we switch the peer connection id, that we keep track off, to the one that the peer has chosen.

Parameters
initialPacket:InitialPacket

the INITIAL packet from the peer

getPeerConnIdback to summary
pack-priv QuicConnectionId getPeerConnId()

Returns the active peer connection ID.

Returns:QuicConnectionId

the active peer connection ID

getPeerConnIdback to summary
private QuicConnectionId getPeerConnId(final long sequenceNum)
handleNewConnectionIdFrameback to summary
pack-priv void handleNewConnectionIdFrame(final NewConnectionIDFrame newCid) throws QuicTransportException

Process the incoming NEW_CONNECTION_ID frame.

Parameters
newCid:NewConnectionIDFrame

the NEW_CONNECTION_ID frame

Exceptions
QuicTransportException:
if the frame violates the protocol
handlePreferredAddressback to summary
pack-priv void handlePreferredAddress(final ByteBuffer preferredConnId, final byte[] preferredStatelessResetToken)

Save the connection ID from the preferred address QUIC transport parameter

Parameters
preferredConnId:ByteBuffer

preferred connection ID

preferredStatelessResetToken:byte[]

preferred stateless reset token

handshakeStatelessResetTokenback to summary
pack-priv void handshakeStatelessResetToken(final byte[] statelessResetToken)

Save the stateless reset token QUIC transport parameter

Parameters
statelessResetToken:byte[]

stateless reset token

insertGapsback to summary
private void insertGaps(long sequenceNumber)
nextFrameback to summary
public QuicFrame nextFrame(int remaining)

Produce a queued RETIRE_CONNECTION_ID frame, if it fits in the packet

Parameters
remaining:int

bytes remaining in the packet

Returns:QuicFrame

a RetireConnectionIdFrame, or null if none is queued or remaining is too low

originalServerConnIdback to summary
pack-priv void originalServerConnId(final QuicConnectionId peerConnId)

Save the client-selected original server connection ID

Parameters
peerConnId:QuicConnectionId

the client-selected original server connection ID

originalServerConnIdback to summary
pack-priv QuicConnectionId originalServerConnId()

Returns the client-selected original server connection ID.

Returns:QuicConnectionId

the client-selected original server connection ID

retirePriorToback to summary
private void retirePriorTo(final long priorTo)
retryConnIdback to summary
pack-priv void retryConnId(final QuicConnectionId peerConnId)

Save the server-selected retry connection ID

Parameters
peerConnId:QuicConnectionId

the server-selected retry connection ID

retryConnIdback to summary
pack-priv QuicConnectionId retryConnId()

Returns the connectionId the server included in the Source Connection ID field of a Retry packet. May be null.

Returns:QuicConnectionId

the connection id sent in the server's retry packet

switchConnectionIdback to summary
private void switchConnectionId()
jdk.internal.net.http.quic back to summary

private final Enum PeerConnIdManager.State

extends Enum<PeerConnIdManager.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final PeerConnIdManager.State
public static final PeerConnIdManager.State
public static final PeerConnIdManager.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static PeerConnIdManager.State
public static PeerConnIdManager.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INITIAL_PKT_NOT_RECEIVED_FROM_PEERback to summary
public static final PeerConnIdManager.State INITIAL_PKT_NOT_RECEIVED_FROM_PEER
PEER_CONN_ID_FINALIZEDback to summary
public static final PeerConnIdManager.State PEER_CONN_ID_FINALIZED
RETRY_PKT_RECEIVED_FROM_PEERback to summary
public static final PeerConnIdManager.State RETRY_PKT_RECEIVED_FROM_PEER

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static PeerConnIdManager.State valueOf(String name)
valuesback to summary
public static PeerConnIdManager.State[] values()