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 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) getClientSessionId(Map<String, List<String>> headers) 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) getRuntimeSessionId(Map<String, List<String>> headers) getRuntimeVersion(Map<String, List<String>> headers) static Optional<CompressionAlgorithm> getSelectedCompressionAlgorithm(Map<String, List<String>> headers) static Optional<WebSocketTransportFormat> getSelectedTransportFormat(Map<String, List<String>> headers) 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 String
-
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:
-
-
Method Details
-
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
-