Record Class ReconnectQuery
java.lang.Object
java.lang.Record
com.iizix.comm.session.ReconnectQuery
- Record Components:
sessionID- The session identifier the client comes back to, never empty.serial- The next serial number the client expects to receive, 1 to 0xFFFF.token- The reconnect token the client presented, null when the query carries none.
The query of a WebSocket reconnection,
reconnect=<session ID>&serial=<next serial>[&rt=<reconnect token>], parsed once for every end point constructor that accepts reconnections (the client's and VSViewer's), so that both read it the same way (CC-FIX-RECONNECT-TOKEN). Before, each cut the serial as everything after &serial=, and a member after it made the serial unreadable and the reconnection unhandled.The members are read by name, in any order; a name that is none of the three is ignored. The serial must be a decimal number from 1 to 65535. The token is kept as it came: hex characters of the server's own making, compared by the session's manager in constant time; a client older than v5.1 sends none (token null, SH-D-2).
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the session identifier member,reconnect: the query of a reconnection starts with it.static final StringThe name of the serial member,serial.static final StringThe name of the reconnect token member,rt: masked in every log, as the password members are.Constructor Summary
ConstructorsConstructorDescriptionReconnectQuery(String sessionID, int serial, String token) Creates an instance of aReconnectQueryrecord class.Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static ReconnectQueryParses the query of a WebSocket upgrade as a reconnection.intserial()Returns the value of theserialrecord component.Returns the value of thesessionIDrecord component.token()Returns the value of thetokenrecord component.final StringtoString()Returns a string representation of this record class.
Field Details
RECONNECT
The name of the session identifier member,reconnect: the query of a reconnection starts with it.- See Also:
SERIAL
TOKEN
The name of the reconnect token member,rt: masked in every log, as the password members are.- See Also:
Constructor Details
ReconnectQuery
Method Details
parse
Parses the query of a WebSocket upgrade as a reconnection.- Parameters:
query- The query, without the question mark, null for none.- Returns:
- The reconnection, or null when the query is not one: it does not start with
reconnect=, the identifier is empty, the serial is missing or not a number from 1 to 65535.
toString
hashCode
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes.sessionID
serial
token