public final class Handshake
extends java.lang.Object
| Modifier and Type | Method and Description | 
|---|---|
| static Handshake | createClientHandshake(RequestContext webSocketRequest)Client-side handshake. | 
| RequestContext | getRequest()Client side only - get the  UpgradeRequest. | 
| UpgradeRequest | prepareRequest()Client side only - compose the  UpgradeRequestand store it for further use. | 
| void | setExtensions(java.util.List<Extension> extensions)Client side only - set the list of supported extensions. | 
| void | setSubProtocols(java.util.List<java.lang.String> subProtocols)Client side only - set the list of supported subprotocols. | 
| static void | updateHostAndOrigin(UpgradeRequest upgradeRequest)Client side only - Generate host and origin header and put them to the upgrade request headers. | 
| void | validateServerResponse(UpgradeResponse response)Client side only - validate server response. | 
public static Handshake createClientHandshake(RequestContext webSocketRequest)
webSocketRequest - request representation to be modified for use as WebSocket handshake request.public RequestContext getRequest()
UpgradeRequest.UpgradeRequest created on this HandShake.public void setSubProtocols(java.util.List<java.lang.String> subProtocols)
subProtocols - list of supported subprotocol.public void setExtensions(java.util.List<Extension> extensions)
extensions - list of supported extensions.public UpgradeRequest prepareRequest()
UpgradeRequest and store it for further use.UpgradeRequest.public void validateServerResponse(UpgradeResponse response) throws HandshakeException
response - response to be validated.HandshakeException - when HTTP Status of received response is not 101 - Switching protocols.public static void updateHostAndOrigin(UpgradeRequest upgradeRequest)
upgradeRequest - upgrade request to be updated.Copyright © 2012–2020 Oracle Corporation. All rights reserved.