public class PerMessageDeflateHandshake extends Object implements ExtensionHandshake
permessage-deflate
WebSocket Extension handshake.
This implementation supports parameters: server_no_context_takeover, client_no_context_takeover
.
This implementation does not support parameters: server_max_window_bits, client_max_window_bits
.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DEFLATER
Default configuration for DEFLATE algorithm implementation
|
Constructor and Description |
---|
PerMessageDeflateHandshake() |
PerMessageDeflateHandshake(boolean client)
Create a new
PerMessageDeflateHandshake instance. |
PerMessageDeflateHandshake(boolean client,
boolean compressContextTakeover,
boolean decompressContextTakeover)
Create a new
PerMessageDeflateHandshake instance. |
PerMessageDeflateHandshake(boolean client,
int deflaterLevel)
Create a new
PerMessageDeflateHandshake instance. |
PerMessageDeflateHandshake(boolean client,
int deflaterLevel,
boolean compressContextTakeover,
boolean decompressContextTakeover)
Create a new
PerMessageDeflateHandshake instance. |
Modifier and Type | Method and Description |
---|---|
WebSocketExtension |
accept(WebSocketExtension extension)
Validate if an extension request is accepted.
|
ExtensionFunction |
create()
Create a new instance of the
ExtensionFunction associated to this WebSocket Extension. |
String |
getName() |
boolean |
isIncompatible(List<ExtensionHandshake> extensions)
Validate if current extension is compatible with previously negotiated in the server side.
|
public static final int DEFAULT_DEFLATER
public PerMessageDeflateHandshake()
public PerMessageDeflateHandshake(boolean client)
PerMessageDeflateHandshake
instance.client
- indicate if extension is configured in client (true
) context or server (false
) context.public PerMessageDeflateHandshake(boolean client, int deflaterLevel)
PerMessageDeflateHandshake
instance.client
- indicate if extension is configured in client (true
) context or server (false
) contextdeflaterLevel
- the level of configuration of DEFLATE algorithm implementationpublic PerMessageDeflateHandshake(boolean client, boolean compressContextTakeover, boolean decompressContextTakeover)
PerMessageDeflateHandshake
instance.client
- flag for client (true
) context or server (false
) contextcompressContextTakeover
- flag for compressor context takeover or without compressor contextdecompressContextTakeover
- flag for decompressor context takeover or without decompressor contextpublic PerMessageDeflateHandshake(boolean client, int deflaterLevel, boolean compressContextTakeover, boolean decompressContextTakeover)
PerMessageDeflateHandshake
instance.client
- flag for client (true
) context or server (false
) contextdeflaterLevel
- the level of configuration of DEFLATE algorithm implementationcompressContextTakeover
- flag for compressor context takeover or without compressor contextdecompressContextTakeover
- flag for decompressor context takeover or without decompressor contextpublic String getName()
getName
in interface ExtensionHandshake
public WebSocketExtension accept(WebSocketExtension extension)
ExtensionHandshake
accept
in interface ExtensionHandshake
extension
- the extension request representationWebSocketExtension
instance with parameters accepted;
null
in case extension request is not acceptedpublic boolean isIncompatible(List<ExtensionHandshake> extensions)
ExtensionHandshake
isIncompatible
in interface ExtensionHandshake
extensions
- a list of negotiated extensionstrue
if current extension is compatible;
false
if current extension is not compatiblepublic ExtensionFunction create()
ExtensionHandshake
ExtensionFunction
associated to this WebSocket Extension.create
in interface ExtensionHandshake
ExtensionFunction
Copyright © 2017 JBoss by Red Hat. All rights reserved.