Top Methods
org.eclipse.jetty.websocket.core.server

public Interface Handshaker

Known Direct Implementers
org.eclipse.jetty.websocket.core.server.internal.AbstractHandshaker, org.eclipse.jetty.websocket.core.server.internal.HandshakerSelector
Imports
org.eclipse.jetty.server.Request, .Response, org.eclipse.jetty.util.Callback, org.eclipse.jetty.websocket.core.Configuration, .WebSocketComponents, org.eclipse.jetty.websocket.core.exception.WebSocketException, org.eclipse.jetty.websocket.core.server.internal.HandshakerSelector

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the request is thought to be a valid websocket upgrade request.
isWebSocketUpgradeRequest
(Request
the request
request
)

A preliminary check to see if a request is likely to be a valid WebSocket Upgrade Request.

public static Handshaker
public boolean

Returns:

true if a response was generated, false if a response is not generated
upgradeRequest
(WebSocketNegotiator
the negotiator
negotiator
,
Request
the request
request
,
Response
the response
response
,
Callback
the callback
callback
,
WebSocketComponents
the WebSocket components
components
,
Configuration.Customizer
the customizer
defaultCustomizer
)

Attempts to upgrade a request to WebSocket.

Method Detail

isWebSocketUpgradeRequestback to summary
public boolean isWebSocketUpgradeRequest(Request request)

A preliminary check to see if a request is likely to be a valid WebSocket Upgrade Request. If this returns true the Request may be a valid upgrade request, but if this returns false returns false you can avoid calling upgradeRequest(WebSocketNegotiator, Request, Response, Callback, WebSocketComponents, Configuration.Customizer) entirely as it will always fail

Parameters
request:Request

the request

Returns:boolean

true if the request is thought to be a valid websocket upgrade request.

newInstanceback to summary
public static Handshaker newInstance()
upgradeRequestback to summary
public boolean upgradeRequest(WebSocketNegotiator negotiator, Request request, Response response, Callback callback, WebSocketComponents components, Configuration.Customizer defaultCustomizer) throws WebSocketException

Attempts to upgrade a request to WebSocket.

Returns true if the WebSocket upgrade is successful and a successful response is generated and the callback eventually completed, or if the WebSocket upgrade failed and a failure response is generated and the callback eventually completed. Returns false if a response is not generated and the caller is responsible for generating a response and completing the callback.

Parameters
negotiator:WebSocketNegotiator

the negotiator

request:Request

the request

response:Response

the response

callback:Callback

the callback

components:WebSocketComponents

the WebSocket components

defaultCustomizer:Configuration.Customizer

the customizer

Returns:boolean

true if a response was generated, false if a response is not generated

Exceptions
WebSocketException:
there is an error during the upgrade