public final class Handshake extends 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
UpgradeRequest and store it for further use. |
void |
setExtensions(List<Extension> extensions)
Client side only - set the list of supported extensions.
|
void |
setSubProtocols(List<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(List<String> subProtocols)
subProtocols
- list of supported subprotocol.public void setExtensions(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–2019 Oracle Corporation. All rights reserved.