Top Description Fields Constructors Methods
io.undertow.websockets.extensions

public Class PerMessageDeflateHandshake

extends Object
implements ExtensionHandshake
Class Inheritance
All Implemented Interfaces
io.undertow.websockets.extensions.ExtensionHandshake
Imports
java.util.HashSet, .List, .Set, java.util.zip.Deflater, io.undertow.websockets.WebSocketExtension, io.undertow.websockets.core.WebSocketLogger

Implementation of 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 .

Author
Lucas Ponce
See Also
Compression Extensions for WebSocket

Field Summary

Modifier and TypeField and Description
private final boolean
private static final String
private static final String
private boolean
private boolean
public static final int
DEFAULT_DEFLATER

Default configuration for DEFLATE algorithm implementation

private final int
private final Set<String>
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public
public
PerMessageDeflateHandshake(final boolean
indicate if extension is configured in client (true ) context or server (false ) context.
client
)

Create a new PerMessageDeflateHandshake instance.

public
PerMessageDeflateHandshake(final boolean
indicate if extension is configured in client (true ) context or server (false ) context
client
,
final int
the level of configuration of DEFLATE algorithm implementation
deflaterLevel
)

Create a new PerMessageDeflateHandshake instance.

public
PerMessageDeflateHandshake(final boolean
flag for client (true ) context or server (false ) context
client
,
boolean
flag for compressor context takeover or without compressor context
compressContextTakeover
,
boolean
flag for decompressor context takeover or without decompressor context
decompressContextTakeover
)

Create a new PerMessageDeflateHandshake instance.

public
PerMessageDeflateHandshake(final boolean
flag for client (true ) context or server (false ) context
client
,
final int
the level of configuration of DEFLATE algorithm implementation
deflaterLevel
,
boolean
flag for compressor context takeover or without compressor context
compressContextTakeover
,
boolean
flag for decompressor context takeover or without decompressor context
decompressContextTakeover
)

Create a new PerMessageDeflateHandshake instance.

Method Summary

Modifier and TypeMethod and Description
public WebSocketExtension
accept(final WebSocketExtension
the extension request representation
extension
)

Implements io.undertow.websockets.extensions.ExtensionHandshake.accept.

Validate if an extension request is accepted.

public ExtensionFunction
create()

Implements io.undertow.websockets.extensions.ExtensionHandshake.create.

Create a new instance of the ExtensionFunction associated to this WebSocket Extension.

public String
public boolean
isIncompatible(List<ExtensionHandshake>
a list of negotiated extensions
extensions
)

Implements io.undertow.websockets.extensions.ExtensionHandshake.isIncompatible.

Validate if current extension is compatible with previously negotiated in the server side.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientback to summary
private final boolean client
CLIENT_MAX_WINDOW_BITSback to summary
private static final String CLIENT_MAX_WINDOW_BITS
CLIENT_NO_CONTEXT_TAKEOVERback to summary
private static final String CLIENT_NO_CONTEXT_TAKEOVER
compressContextTakeoverback to summary
private boolean compressContextTakeover
decompressContextTakeoverback to summary
private boolean decompressContextTakeover
DEFAULT_DEFLATERback to summary
public static final int DEFAULT_DEFLATER

Default configuration for DEFLATE algorithm implementation

deflaterLevelback to summary
private final int deflaterLevel
incompatibleExtensionsback to summary
private final Set<String> incompatibleExtensions
PERMESSAGE_DEFLATEback to summary
private static final String PERMESSAGE_DEFLATE
SERVER_MAX_WINDOW_BITSback to summary
private static final String SERVER_MAX_WINDOW_BITS
SERVER_NO_CONTEXT_TAKEOVERback to summary
private static final String SERVER_NO_CONTEXT_TAKEOVER

Constructor Detail

PerMessageDeflateHandshakeback to summary
public PerMessageDeflateHandshake()
PerMessageDeflateHandshakeback to summary
public PerMessageDeflateHandshake(final boolean client)

Create a new PerMessageDeflateHandshake instance.

Parameters
client:boolean

indicate if extension is configured in client (true ) context or server (false ) context.

PerMessageDeflateHandshakeback to summary
public PerMessageDeflateHandshake(final boolean client, final int deflaterLevel)

Create a new PerMessageDeflateHandshake instance.

Parameters
client:boolean

indicate if extension is configured in client (true ) context or server (false ) context

deflaterLevel:int

the level of configuration of DEFLATE algorithm implementation

PerMessageDeflateHandshakeback to summary
public PerMessageDeflateHandshake(final boolean client, boolean compressContextTakeover, boolean decompressContextTakeover)

Create a new PerMessageDeflateHandshake instance.

Parameters
client:boolean

flag for client (true ) context or server (false ) context

compressContextTakeover:boolean

flag for compressor context takeover or without compressor context

decompressContextTakeover:boolean

flag for decompressor context takeover or without decompressor context

PerMessageDeflateHandshakeback to summary
public PerMessageDeflateHandshake(final boolean client, final int deflaterLevel, boolean compressContextTakeover, boolean decompressContextTakeover)

Create a new PerMessageDeflateHandshake instance.

Parameters
client:boolean

flag for client (true ) context or server (false ) context

deflaterLevel:int

the level of configuration of DEFLATE algorithm implementation

compressContextTakeover:boolean

flag for compressor context takeover or without compressor context

decompressContextTakeover:boolean

flag for decompressor context takeover or without decompressor context

Method Detail

acceptback to summary
public WebSocketExtension accept(final WebSocketExtension extension)

Implements io.undertow.websockets.extensions.ExtensionHandshake.accept.

Doc from io.undertow.websockets.extensions.ExtensionHandshake.accept.

Validate if an extension request is accepted.

Parameters
extension:WebSocketExtension

the extension request representation

Returns:WebSocketExtension

a new WebSocketExtension instance with parameters accepted; null in case extension request is not accepted

Annotations
@Override
createback to summary
public ExtensionFunction create()

Implements io.undertow.websockets.extensions.ExtensionHandshake.create.

Doc from io.undertow.websockets.extensions.ExtensionHandshake.create.

Create a new instance of the ExtensionFunction associated to this WebSocket Extension.

Returns:ExtensionFunction

a new instance ExtensionFunction

Annotations
@Override
getNameback to summary
public String getName()

Implements io.undertow.websockets.extensions.ExtensionHandshake.getName.

Returns:String

Doc from io.undertow.websockets.extensions.ExtensionHandshake.getName.

name of the WebSocket Extension

Annotations
@Override
isIncompatibleback to summary
public boolean isIncompatible(List<ExtensionHandshake> extensions)

Implements io.undertow.websockets.extensions.ExtensionHandshake.isIncompatible.

Doc from io.undertow.websockets.extensions.ExtensionHandshake.isIncompatible.

Validate if current extension is compatible with previously negotiated in the server side.

Parameters
extensions:List<ExtensionHandshake>

a list of negotiated extensions

Returns:boolean

true if current extension is compatible; false if current extension is not compatible

Annotations
@Override