Class WebSocketCapabilities
java.lang.Object
io.fluxzero.common.websocket.WebSocketCapabilities
Utility methods for exchanging Fluxzero websocket client capabilities through handshake headers.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionasHeaders(Collection<CompressionAlgorithm> supportedCompressionAlgorithms) Serializes the supplied compression capabilities 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.getRuntimeSessionId(Map<String, List<String>> headers) getRuntimeVersion(Map<String, List<String>> headers) static Optional<CompressionAlgorithm> getSelectedCompressionAlgorithm(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 String
-
Field Details
-
SUPPORTED_COMPRESSION_ALGORITHMS_HEADER
- See Also:
-
SELECTED_COMPRESSION_ALGORITHM_HEADER
- See Also:
-
CLIENT_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
-
getSupportedCompressionAlgorithms
-
getPreferredCompressionAlgorithm
-
getSelectedCompressionAlgorithm
-
getClientSessionId
-
getClientSdkVersion
-
getRuntimeSessionId
-
getRuntimeVersion
-
newShortSessionId
-