Package io.github.mahmoudimus.quic.tls
Record Class EarlyDataAttempt
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.tls.EarlyDataAttempt
- Record Components:
serverName- the server name of the ClientHello (and of the ticket), or nullalpn- the application protocol selected for this connection, which the ticket's matchesticketId- a random identifier of the ticket, unique per ticket the server issuedissued- when the server issued the ticketclientTicketAge- the ticket's age the client reports, de-obfuscatedserverTicketAge- the ticket's age by the server's clock
public record EarlyDataAttempt(String serverName, String alpn, byte[] ticketId, Instant issued, Duration clientTicketAge, Duration serverTicketAge)
extends Record
A resuming client's offer of 0-RTT data, as an
EarlyDataPolicy sees it.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionageSkew()How far the two ticket ages differ: a replay of an old first flight shows up as a large difference, since the client's reported age is frozen in it.alpn()Returns the value of thealpnrecord component.Returns the value of theclientTicketAgerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.issued()Returns the value of theissuedrecord component.Returns the value of theserverNamerecord component.Returns the value of theserverTicketAgerecord component.byte[]ticketId()The ticket's identifier.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EarlyDataAttempt
public EarlyDataAttempt(String serverName, String alpn, byte[] ticketId, Instant issued, Duration clientTicketAge, Duration serverTicketAge) An attempt.- Parameters:
serverName- the server name, or nullalpn- the selected application protocolticketId- the ticket's identifier, copiedissued- when the ticket was issuedclientTicketAge- the client's ticket ageserverTicketAge- the server's ticket age
-
-
Method Details
-
ticketId
public byte[] ticketId()The ticket's identifier.- Returns:
- a copy
-
ageSkew
How far the two ticket ages differ: a replay of an old first flight shows up as a large difference, since the client's reported age is frozen in it.- Returns:
- the absolute difference
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
serverName
Returns the value of theserverNamerecord component.- Returns:
- the value of the
serverNamerecord component
-
alpn
Returns the value of thealpnrecord component.- Returns:
- the value of the
alpnrecord component
-
issued
Returns the value of theissuedrecord component.- Returns:
- the value of the
issuedrecord component
-
clientTicketAge
Returns the value of theclientTicketAgerecord component.- Returns:
- the value of the
clientTicketAgerecord component
-
serverTicketAge
Returns the value of theserverTicketAgerecord component.- Returns:
- the value of the
serverTicketAgerecord component
-