Class DeflateFrameClientExtensionHandshaker
java.lang.Object
io.netty.handler.codec.http.websocketx.extensions.compression.DeflateFrameClientExtensionHandshaker
- All Implemented Interfaces:
WebSocketClientExtensionHandshaker
public final class DeflateFrameClientExtensionHandshaker
extends Object
implements WebSocketClientExtensionHandshaker
perframe-deflate
handshake implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final WebSocketExtensionFilterProvider
private final boolean
-
Constructor Summary
ConstructorsConstructorDescriptionDeflateFrameClientExtensionHandshaker
(boolean useWebkitExtensionName) Constructor with default configuration.DeflateFrameClientExtensionHandshaker
(int compressionLevel, boolean useWebkitExtensionName) Constructor with custom configuration.DeflateFrameClientExtensionHandshaker
(int compressionLevel, boolean useWebkitExtensionName, WebSocketExtensionFilterProvider extensionFilterProvider) Constructor with custom configuration. -
Method Summary
Modifier and TypeMethodDescriptionhandshakeExtension
(WebSocketExtensionData extensionData) Handshake based on server response.Return extension configuration to submit to the server.
-
Field Details
-
compressionLevel
private final int compressionLevel -
useWebkitExtensionName
private final boolean useWebkitExtensionName -
extensionFilterProvider
-
-
Constructor Details
-
DeflateFrameClientExtensionHandshaker
public DeflateFrameClientExtensionHandshaker(boolean useWebkitExtensionName) Constructor with default configuration. -
DeflateFrameClientExtensionHandshaker
public DeflateFrameClientExtensionHandshaker(int compressionLevel, boolean useWebkitExtensionName) Constructor with custom configuration.- Parameters:
compressionLevel
- Compression level between 0 and 9 (default is 6).
-
DeflateFrameClientExtensionHandshaker
public DeflateFrameClientExtensionHandshaker(int compressionLevel, boolean useWebkitExtensionName, WebSocketExtensionFilterProvider extensionFilterProvider) Constructor with custom configuration.- Parameters:
compressionLevel
- Compression level between 0 and 9 (default is 6).extensionFilterProvider
- provides client extension filters for per frame deflate encoder and decoder.
-
-
Method Details
-
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
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.
-