Interface WebSocket<T>
- All Known Implementing Classes:
AbstractWebsocketDefinition, AnonymousWebsocket, ModelValidationWebsocketDefinition, SecureWebsocket, SqlLoggingWebsocketDefinition, ToccoWebsocketDefinition
public interface WebSocket<T>
-
Method Summary
Modifier and TypeMethodDescriptionCreate an instance of the WebSocket implementation.getPath()The relative path where this endpoint should be published.voidonHandshake(Map<String, Object> userProperties) Called when the WebSocket connection is initialized.voidsendMessage(Callable<Optional<String>> message) Sends a message to all clients that are connected to this endpoint.voidsendMessageToOrigin(String originId, Callable<Optional<String>> message) Sends a message to a certain client.default voidsendMessageToUser(String username, Callable<Optional<String>> message) Classof the WebSocket implementation (must extend javax.websocket.Endpoint)
-
Method Details
-
webSocketClass
-
createWebSocketInstance
T createWebSocketInstance()Create an instance of the WebSocket implementation. This method allows custom initialization of the WebSocket class.A new instance will be created for every new WebSocket connection.
-
getPath
String getPath()The relative path where this endpoint should be published. Should start with '/nice2/websocket/' for consistency reasons. -
onHandshake
-
sendMessage
-
sendMessageToOrigin
-
sendMessageToUser
-