Interface ExtensionHandshake
- All Known Implementing Classes:
PerMessageDeflateHandshake
public interface ExtensionHandshake
Base interface for WebSocket Extension handshake.
It is responsible of the definition and negotiation logic of a WebSocket Extension. It interacts at the handshake phase.
It creates new instances of ExtensionFunction
.
- Author:
- Lucas Ponce
-
Method Summary
Modifier and TypeMethodDescriptionaccept
(WebSocketExtension extension) Validate if an extension request is accepted.create()
Create a new instance of theExtensionFunction
associated to this WebSocket Extension.getName()
boolean
isIncompatible
(List<ExtensionHandshake> extensions) Validate if current extension is compatible with previously negotiated in the server side.
-
Method Details
-
getName
String getName()- Returns:
- name of the WebSocket Extension
-
accept
Validate if an extension request is accepted.- Parameters:
extension
- the extension request representation- Returns:
- a new
WebSocketExtension
instance with parameters accepted;null
in case extension request is not accepted
-
isIncompatible
Validate if current extension is compatible with previously negotiated in the server side.- Parameters:
extensions
- a list of negotiated extensions- Returns:
true
if current extension is compatible;false
if current extension is not compatible
-
create
ExtensionFunction create()Create a new instance of theExtensionFunction
associated to this WebSocket Extension.- Returns:
- a new instance
ExtensionFunction
-