Module io.netty5.codec.http
Class PerMessageDeflateClientExtensionHandshaker
- java.lang.Object
-
- io.netty5.handler.codec.http.websocketx.extensions.compression.PerMessageDeflateClientExtensionHandshaker
-
- All Implemented Interfaces:
WebSocketClientExtensionHandshaker
public final class PerMessageDeflateClientExtensionHandshaker extends Object implements WebSocketClientExtensionHandshaker
permessage-deflate handshake implementation.
-
-
Constructor Summary
Constructors Constructor Description PerMessageDeflateClientExtensionHandshaker()
Constructor with default configuration.PerMessageDeflateClientExtensionHandshaker(int compressionLevel, boolean allowClientWindowSize, int requestedServerWindowSize, boolean allowClientNoContext, boolean requestedServerNoContext)
Constructor with custom configuration.PerMessageDeflateClientExtensionHandshaker(int compressionLevel, boolean allowClientWindowSize, int requestedServerWindowSize, boolean allowClientNoContext, boolean requestedServerNoContext, WebSocketExtensionFilterProvider extensionFilterProvider)
Constructor with custom configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebSocketClientExtension
handshakeExtension(WebSocketExtensionData extensionData)
Handshake based on server response.WebSocketExtensionData
newRequestData()
Return extension configuration to submit to the server.
-
-
-
Constructor Detail
-
PerMessageDeflateClientExtensionHandshaker
public PerMessageDeflateClientExtensionHandshaker()
Constructor with default configuration.
-
PerMessageDeflateClientExtensionHandshaker
public PerMessageDeflateClientExtensionHandshaker(int compressionLevel, boolean allowClientWindowSize, int requestedServerWindowSize, boolean allowClientNoContext, boolean requestedServerNoContext)
Constructor with custom configuration.- Parameters:
compressionLevel
- Compression level between 0 and 9 (default is 6).allowClientWindowSize
- allows WebSocket server to customize the client inflater window size (default is false).requestedServerWindowSize
- indicates the requested sever window size to use if server inflater is customizable.allowClientNoContext
- allows WebSocket server to activate client_no_context_takeover (default is false).requestedServerNoContext
- indicates if client needs to activate server_no_context_takeover if server is compatible with (default is false).
-
PerMessageDeflateClientExtensionHandshaker
public PerMessageDeflateClientExtensionHandshaker(int compressionLevel, boolean allowClientWindowSize, int requestedServerWindowSize, boolean allowClientNoContext, boolean requestedServerNoContext, WebSocketExtensionFilterProvider extensionFilterProvider)
Constructor with custom configuration.- Parameters:
compressionLevel
- Compression level between 0 and 9 (default is 6).allowClientWindowSize
- allows WebSocket server to customize the client inflater window size (default is false).requestedServerWindowSize
- indicates the requested sever window size to use if server inflater is customizable.allowClientNoContext
- allows WebSocket server to activate client_no_context_takeover (default is false).requestedServerNoContext
- indicates if client needs to activate server_no_context_takeover if server is compatible with (default is false).extensionFilterProvider
- provides client extension filters for per message deflate encoder and decoder.
-
-
Method Detail
-
newRequestData
public WebSocketExtensionData newRequestData()
Description copied from interface:WebSocketClientExtensionHandshaker
Return extension configuration to submit to the server.- Specified by:
newRequestData
in interfaceWebSocketClientExtensionHandshaker
- Returns:
- the desired extension configuration.
-
handshakeExtension
public WebSocketClientExtension handshakeExtension(WebSocketExtensionData extensionData)
Description copied from interface:WebSocketClientExtensionHandshaker
Handshake based on server response. It should always succeed because server response should be a request acknowledge.- Specified by:
handshakeExtension
in interfaceWebSocketClientExtensionHandshaker
- Parameters:
extensionData
- the extension configuration sent by the server.- Returns:
- an initialized extension if handshake phase succeed or null if failed.
-
-