Class BaseWebsocket
java.lang.Object
jakarta.websocket.Endpoint
ch.tocco.nice2.web.core.api.websocket.BaseWebsocket
- Direct Known Subclasses:
 AbstractWebsocket,ToccoWebsocket
public abstract class BaseWebsocket
extends jakarta.websocket.Endpoint
Base WebSocket implementation that runs the methods
 using the 
SecurityContext that was used during the handshake.
 
 It is verified if the nice session that belongs to that SecurityContext
 is still active, otherwise the connection will be closed.
 
One instance of this class will be created per client.
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(BaseWebsocketListener listener) voidclose()protected voiddoOnClose(jakarta.websocket.Session session) Called when the connection has been closed (called only once per instance)protected voidprotected abstract voiddoOnMessage(jakarta.websocket.Session session, String message) Called when a message has arrived from the client that is bound to this instance.protected voiddoOnOpen(jakarta.websocket.Session session, jakarta.websocket.EndpointConfig config) Called when the connection has been established (called only once per instance)final voidonClose(jakarta.websocket.Session session, jakarta.websocket.CloseReason closeReason) final voidfinal voidonOpen(jakarta.websocket.Session session, jakarta.websocket.EndpointConfig config) voidsendMessage(Callable<Optional<String>> callable)  
- 
Constructor Details
- 
BaseWebsocket
protected BaseWebsocket(int idleTimeoutSeconds)  
 - 
 - 
Method Details
- 
addListener
 - 
getUserProperties
 - 
sendMessage
 - 
close
public void close() - 
onOpen
public final void onOpen(jakarta.websocket.Session session, jakarta.websocket.EndpointConfig config) - Specified by:
 onOpenin classjakarta.websocket.Endpoint
 - 
onClose
public final void onClose(jakarta.websocket.Session session, jakarta.websocket.CloseReason closeReason) - Overrides:
 onClosein classjakarta.websocket.Endpoint
 - 
onError
- Overrides:
 onErrorin classjakarta.websocket.Endpoint
 - 
doOnMessage
Called when a message has arrived from the client that is bound to this instance. - 
doOnOpen
protected void doOnOpen(jakarta.websocket.Session session, jakarta.websocket.EndpointConfig config) Called when the connection has been established (called only once per instance) - 
doOnClose
protected void doOnClose(jakarta.websocket.Session session) Called when the connection has been closed (called only once per instance) - 
doOnError
 
 -