Class DeflateFrameServerExtensionHandshaker
java.lang.Object
io.netty.handler.codec.http.websocketx.extensions.compression.DeflateFrameServerExtensionHandshaker
- All Implemented Interfaces:
WebSocketServerExtensionHandshaker
public final class DeflateFrameServerExtensionHandshaker
extends Object
implements WebSocketServerExtensionHandshaker
perframe-deflate
handshake implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intstatic final intstatic final int(package private) static final Stringprivate final WebSocketExtensionFilterProviderstatic final intstatic final intprivate final intprivate final intstatic final intstatic final intprivate final int(package private) static final String -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.DeflateFrameServerExtensionHandshaker(int compressionLevel) Deprecated.DeflateFrameServerExtensionHandshaker(int compressionLevel, int maxAllocation) Constructor with custom configuration.DeflateFrameServerExtensionHandshaker(int compressionLevel, int windowSize, int memLevel, int maxAllocation) Constructor with custom configuration including compressor memory limits.DeflateFrameServerExtensionHandshaker(int compressionLevel, int windowSize, int memLevel, WebSocketExtensionFilterProvider extensionFilterProvider, int maxAllocation) Constructor with full custom configuration.DeflateFrameServerExtensionHandshaker(int compressionLevel, WebSocketExtensionFilterProvider extensionFilterProvider) DeflateFrameServerExtensionHandshaker(int compressionLevel, WebSocketExtensionFilterProvider extensionFilterProvider, int maxAllocation) -
Method Summary
Modifier and TypeMethodDescriptionhandshakeExtension(WebSocketExtensionData extensionData) Handshake based on client request.
-
Field Details
-
DEFAULT_COMPRESSION_LEVEL
public static final int DEFAULT_COMPRESSION_LEVEL- See Also:
-
MIN_WINDOW_SIZE
public static final int MIN_WINDOW_SIZE- See Also:
-
MAX_WINDOW_SIZE
public static final int MAX_WINDOW_SIZE- See Also:
-
DEFAULT_MEM_LEVEL
public static final int DEFAULT_MEM_LEVEL- See Also:
-
MIN_MEM_LEVEL
public static final int MIN_MEM_LEVEL- See Also:
-
MAX_MEM_LEVEL
public static final int MAX_MEM_LEVEL- See Also:
-
X_WEBKIT_DEFLATE_FRAME_EXTENSION
- See Also:
-
DEFLATE_FRAME_EXTENSION
- See Also:
-
compressionLevel
private final int compressionLevel -
windowSize
private final int windowSize -
memLevel
private final int memLevel -
extensionFilterProvider
-
maxAllocation
private final int maxAllocation
-
-
Constructor Details
-
DeflateFrameServerExtensionHandshaker
Deprecated.Constructor with default configuration. -
DeflateFrameServerExtensionHandshaker
Deprecated.Constructor with custom configuration.- Parameters:
compressionLevel- Compression level between 0 and 9 (default is 6).
-
DeflateFrameServerExtensionHandshaker
public DeflateFrameServerExtensionHandshaker(int compressionLevel, int maxAllocation) Constructor with custom configuration.- Parameters:
compressionLevel- Compression level between 0 and 9 (default is 6).maxAllocation- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited.
-
DeflateFrameServerExtensionHandshaker
public DeflateFrameServerExtensionHandshaker(int compressionLevel, int windowSize, int memLevel, int maxAllocation) Constructor with custom configuration including compressor memory limits.- Parameters:
compressionLevel- Compression level between 0 and 9 (default is 6).windowSize- zlib window size in bits (8-15) for the server-side deflater. Lower values reduce per-connection memory at the cost of compression ratio.memLevel- zlib memory level for the server-side deflater (1-9). Lower values reduce per-connection memory at the cost of compression ratio.maxAllocation- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited.
-
DeflateFrameServerExtensionHandshaker
@Deprecated public DeflateFrameServerExtensionHandshaker(int compressionLevel, WebSocketExtensionFilterProvider extensionFilterProvider) Constructor with custom configuration.- Parameters:
compressionLevel- Compression level between 0 and 9 (default is 6).extensionFilterProvider- provides server extension filters for per frame deflate encoder and decoder.
-
DeflateFrameServerExtensionHandshaker
@Deprecated public DeflateFrameServerExtensionHandshaker(int compressionLevel, WebSocketExtensionFilterProvider extensionFilterProvider, int maxAllocation) Deprecated.Constructor with custom configuration.- Parameters:
compressionLevel- Compression level between 0 and 9 (default is 6).extensionFilterProvider- provides server extension filters for per frame deflate encoder and decoder.maxAllocation- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited.
-
DeflateFrameServerExtensionHandshaker
public DeflateFrameServerExtensionHandshaker(int compressionLevel, int windowSize, int memLevel, WebSocketExtensionFilterProvider extensionFilterProvider, int maxAllocation) Constructor with full custom configuration.- Parameters:
compressionLevel- Compression level between 0 and 9 (default is 6).windowSize- zlib window size in bits (8-15) for the server-side deflater.memLevel- zlib memory level for the server-side deflater (1-9).extensionFilterProvider- provides server extension filters for per frame deflate encoder and decoder.maxAllocation- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited.
-
-
Method Details
-
handshakeExtension
Description copied from interface:WebSocketServerExtensionHandshakerHandshake based on client request. It must failed with null if server cannot handle it.- Specified by:
handshakeExtensionin interfaceWebSocketServerExtensionHandshaker- Parameters:
extensionData- the extension configuration sent by the client.- Returns:
- an initialized extension if handshake phase succeed or null if failed.
-
DeflateFrameServerExtensionHandshaker(int, int)withDEFAULT_COMPRESSION_LEVEL.