Class WebSocketCapabilities
java.lang.Object
io.fluxzero.common.websocket.WebSocketCapabilities
Utility methods for exchanging Fluxzero websocket client capabilities through handshake headers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringFilter languages accepted by the server, including live refresh and independent scan/idle boundaries.static final StringHighest native message envelope version this peer can read, including packed Model-event blocks.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringSupported document compression codecs; stored bytes are preserved when the client knows their codec.static final StringExplicit packed Model membership versions understood by this client (independent of transport format).static final Stringstatic final StringThis reader accepts mixed legacy and binary records within one compact Model-event block. -
Method Summary
Modifier and TypeMethodDescriptionasHeaders(Collection<CompressionAlgorithm> supportedCompressionAlgorithms) Serializes the supplied compression capabilities into websocket request headers.asTransportHeaders(Collection<WebSocketTransportFormat> supportedTransportFormats) Serializes the supplied websocket transport formats into websocket request headers.getClientSdkVersion(Map<String, List<String>> headers) Reads the advertised client SDK version from handshake headers, if present.getClientSessionId(Map<String, List<String>> headers) Reads the client's session identifier from handshake headers, if present.static Optional<CompressionAlgorithm> getPreferredCompressionAlgorithm(Map<String, List<String>> headers) Returns the most preferred compression algorithm advertised via request headers, if available.static Optional<WebSocketTransportFormat> getPreferredTransportFormat(Map<String, List<String>> headers) Returns the most preferred websocket transport format advertised via request headers, if available.getReplacedSessionId(Map<String, List<String>> headers) Reads the identifier of the session being replaced by this connection, if present.getRuntimeSessionId(Map<String, List<String>> headers) Reads the Runtime session identifier from handshake headers, if present.getRuntimeVersion(Map<String, List<String>> headers) Reads the advertised Runtime version from handshake headers, if present.static Optional<CompressionAlgorithm> getSelectedCompressionAlgorithm(Map<String, List<String>> headers) Reads the negotiated compression algorithm from handshake headers, returning empty for a missing or unrecognized selection.static Optional<WebSocketTransportFormat> getSelectedTransportFormat(Map<String, List<String>> headers) Reads the negotiated transport format from handshake headers, returning empty for a missing or unrecognized selection.static List<CompressionAlgorithm> getSupportedCompressionAlgorithms(Map<String, List<String>> headers) Extracts the ordered list of compression algorithms from websocket request headers.static List<WebSocketTransportFormat> getSupportedTransportFormats(Map<String, List<String>> headers) Extracts the ordered list of websocket transport formats from websocket request headers.static StringGenerates a twelve-character hexadecimal session identifier from a random UUID.static booleansupportsConsumerFiltering(Map<String, List<String>> headers) Whether this peer advertises the consumer filter language understood by this SDK.static booleansupportsRoutedEnvelopes(Map<String, List<String>> headers) Routed native envelopes are sent only after an explicit peer capability.
-
Field Details
-
SUPPORTED_DOCUMENT_COMPRESSION_HEADER
Supported document compression codecs; stored bytes are preserved when the client knows their codec.- See Also:
-
SUPPORTED_MODEL_MEMBERSHIP_VERSIONS_HEADER
Explicit packed Model membership versions understood by this client (independent of transport format).- See Also:
-
SUPPORTS_MIXED_MODEL_EVENT_BLOCKS_HEADER
This reader accepts mixed legacy and binary records within one compact Model-event block.- See Also:
-
SUPPORTED_COMPRESSION_ALGORITHMS_HEADER
- See Also:
-
SELECTED_COMPRESSION_ALGORITHM_HEADER
- See Also:
-
SUPPORTED_TRANSPORT_FORMATS_HEADER
- See Also:
-
SELECTED_TRANSPORT_FORMAT_HEADER
- See Also:
-
CLIENT_SESSION_ID_HEADER
- See Also:
-
REPLACES_SESSION_ID_HEADER
- See Also:
-
CLIENT_SDK_VERSION_HEADER
- See Also:
-
RUNTIME_SESSION_ID_HEADER
- See Also:
-
RUNTIME_VERSION_HEADER
- See Also:
-
CONSUMER_FILTER_VERSIONS_HEADER
Filter languages accepted by the server, including live refresh and independent scan/idle boundaries.- See Also:
-
MESSAGE_ENVELOPE_VERSION_HEADER
Highest native message envelope version this peer can read, including packed Model-event blocks.- See Also:
-
-
Method Details
-
supportsConsumerFiltering
-
supportsRoutedEnvelopes
-
asHeaders
public static Map<String, List<String>> asHeaders(Collection<CompressionAlgorithm> supportedCompressionAlgorithms) Serializes the supplied compression capabilities into websocket request headers.- Parameters:
supportedCompressionAlgorithms- ordered list of supported compression algorithms, most preferred first- Returns:
- websocket request headers representing the supplied capabilities
-
asTransportHeaders
public static Map<String, List<String>> asTransportHeaders(Collection<WebSocketTransportFormat> supportedTransportFormats) Serializes the supplied websocket transport formats into websocket request headers.- Parameters:
supportedTransportFormats- ordered list of supported transport formats, most preferred first- Returns:
- websocket request headers representing the supplied transport capabilities
-
getSupportedCompressionAlgorithms
-
getPreferredCompressionAlgorithm
-
getSelectedCompressionAlgorithm
-
getSupportedTransportFormats
-
getPreferredTransportFormat
-
getSelectedTransportFormat
-
getClientSessionId
-
getReplacedSessionId
-
getClientSdkVersion
-
getRuntimeSessionId
-
getRuntimeVersion
-
newShortSessionId
Generates a twelve-character hexadecimal session identifier from a random UUID.
-