Class WebsocketMessagingServiceImpl
java.lang.Object
ch.tocco.nice2.web.core.impl.websocket.WebsocketMessagingServiceImpl
- All Implemented Interfaces:
WebsocketMessagingService
@Component
public class WebsocketMessagingServiceImpl
extends Object
implements WebsocketMessagingService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
sendMessage
(Class<?> target, Callable<Optional<String>> message) Sends a message to all clients of a specific WebSocket endpoint.<T extends BaseWebsocket>
voidSends a message to a certain client of a specific WebSocket endpoint.<T extends BaseWebsocket>
voidSends a message to all clients of a specific WebSocket endpoint that belong to a certain user.void
setWebSockets
(List<WebSocket<?>> webSockets)
-
Constructor Details
-
WebsocketMessagingServiceImpl
public WebsocketMessagingServiceImpl()
-
-
Method Details
-
setWebSockets
-
sendMessage
Description copied from interface:WebsocketMessagingService
Sends a message to all clients of a specific WebSocket endpoint. The target class is the class that is returned byWebSocket.webSocketClass()
- Specified by:
sendMessage
in interfaceWebsocketMessagingService
-
sendMessageToUser
public <T extends BaseWebsocket> void sendMessageToUser(Class<T> target, String principalName, Callable<Optional<String>> message) Description copied from interface:WebsocketMessagingService
Sends a message to all clients of a specific WebSocket endpoint that belong to a certain user. The target class is the class that is returned byWebSocket.webSocketClass()
- Specified by:
sendMessageToUser
in interfaceWebsocketMessagingService
-
sendMessageToOrigin
public <T extends BaseWebsocket> void sendMessageToOrigin(Class<T> target, String originId, Callable<Optional<String>> message) Description copied from interface:WebsocketMessagingService
Sends a message to a certain client of a specific WebSocket endpoint. The target class is the class that is returned byWebSocket.webSocketClass()
- Specified by:
sendMessageToOrigin
in interfaceWebsocketMessagingService
-