Module io.netty5.codec.http
Class PerMessageDeflateServerExtensionHandshaker
- java.lang.Object
-
- io.netty5.handler.codec.http.websocketx.extensions.compression.PerMessageDeflateServerExtensionHandshaker
-
- All Implemented Interfaces:
WebSocketServerExtensionHandshaker
public final class PerMessageDeflateServerExtensionHandshaker extends Object implements WebSocketServerExtensionHandshaker
permessage-deflate handshake implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_WINDOW_SIZE
static int
MIN_WINDOW_SIZE
-
Constructor Summary
Constructors Constructor Description PerMessageDeflateServerExtensionHandshaker()
Constructor with default configuration.PerMessageDeflateServerExtensionHandshaker(int compressionLevel, boolean allowServerWindowSize, int preferredClientWindowSize, boolean allowServerNoContext, boolean preferredClientNoContext)
Constructor with custom configuration.PerMessageDeflateServerExtensionHandshaker(int compressionLevel, boolean allowServerWindowSize, int preferredClientWindowSize, boolean allowServerNoContext, boolean preferredClientNoContext, WebSocketExtensionFilterProvider extensionFilterProvider)
Constructor with custom configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebSocketServerExtension
handshakeExtension(WebSocketExtensionData extensionData)
Handshake based on client request.
-
-
-
Field Detail
-
MIN_WINDOW_SIZE
public static final int MIN_WINDOW_SIZE
- See Also:
- Constant Field Values
-
MAX_WINDOW_SIZE
public static final int MAX_WINDOW_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PerMessageDeflateServerExtensionHandshaker
public PerMessageDeflateServerExtensionHandshaker()
Constructor with default configuration.
-
PerMessageDeflateServerExtensionHandshaker
public PerMessageDeflateServerExtensionHandshaker(int compressionLevel, boolean allowServerWindowSize, int preferredClientWindowSize, boolean allowServerNoContext, boolean preferredClientNoContext)
Constructor with custom configuration.- Parameters:
compressionLevel
- Compression level between 0 and 9 (default is 6).allowServerWindowSize
- allows WebSocket client to customize the server inflater window size (default is false).preferredClientWindowSize
- indicates the preferred client window size to use if client inflater is customizable.allowServerNoContext
- allows WebSocket client to activate server_no_context_takeover (default is false).preferredClientNoContext
- indicates if server prefers to activate client_no_context_takeover if client is compatible with (default is false).
-
PerMessageDeflateServerExtensionHandshaker
public PerMessageDeflateServerExtensionHandshaker(int compressionLevel, boolean allowServerWindowSize, int preferredClientWindowSize, boolean allowServerNoContext, boolean preferredClientNoContext, WebSocketExtensionFilterProvider extensionFilterProvider)
Constructor with custom configuration.- Parameters:
compressionLevel
- Compression level between 0 and 9 (default is 6).allowServerWindowSize
- allows WebSocket client to customize the server inflater window size (default is false).preferredClientWindowSize
- indicates the preferred client window size to use if client inflater is customizable.allowServerNoContext
- allows WebSocket client to activate server_no_context_takeover (default is false).preferredClientNoContext
- indicates if server prefers to activate client_no_context_takeover if client is compatible with (default is false).extensionFilterProvider
- provides server extension filters for per message deflate encoder and decoder.
-
-
Method Detail
-
handshakeExtension
public WebSocketServerExtension handshakeExtension(WebSocketExtensionData extensionData)
Description copied from interface:WebSocketServerExtensionHandshaker
Handshake based on client request. It must failed with null if server cannot handle it.- Specified by:
handshakeExtension
in interfaceWebSocketServerExtensionHandshaker
- Parameters:
extensionData
- the extension configuration sent by the client.- Returns:
- an initialized extension if handshake phase succeed or null if failed.
-
-