Top Description Methods
org.eclipse.jetty.ee10.websocket.server

public Interface JettyWebSocketCreator


Abstract WebSocket creator interface.

Should you desire filtering of the WebSocket object creation due to criteria such as origin or sub-protocol, then you will be required to implement a custom WebSocketCreator implementation.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a websocket object to use, or null if no websocket should be created from this request.
createWebSocket
(JettyServerUpgradeRequest
the request details
req
,
JettyServerUpgradeResponse
the response details
resp
)

Creates a websocket from the incoming request.

Method Detail

createWebSocketback to summary
public Object createWebSocket(JettyServerUpgradeRequest req, JettyServerUpgradeResponse resp) throws Exception

Creates a websocket from the incoming request.

If no websocket is to be created (return value of null), this JettyWebSocketCreator is responsible for sending a response with JettyServerUpgradeResponse#sendError(int, String), JettyServerUpgradeResponse#sendForbidden(String) or JettyServerUpgradeResponse#setStatusCode(int).

Parameters
req:JettyServerUpgradeRequest

the request details

resp:JettyServerUpgradeResponse

the response details

Returns:Object

a websocket object to use, or null if no websocket should be created from this request.

Exceptions
Exception:
if the WebSocket creation throws