Package org.spincast.core.websocket
Class WebsocketEndpointHandlerDefault<R extends RequestContext<?>,W extends WebsocketContext<?>>
java.lang.Object
org.spincast.core.websocket.WebsocketEndpointHandlerDefault<R,W>
- All Implemented Interfaces:
WebsocketEndpointHandler
public class WebsocketEndpointHandlerDefault<R extends RequestContext<?>,W extends WebsocketContext<?>>
extends Object
implements WebsocketEndpointHandler
-
Field Summary
-
Constructor Summary
ConstructorDescriptionWebsocketEndpointHandlerDefault
(String endpointId, WebsocketController<R, W> controller, WebsocketContextFactory<W> websocketContextFactory, Server server) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected WebsocketPeerManager
createWebsocketPeerManager
(String peerId) Creates a peer specific manager from the endpoint manager.protected WebsocketController<R,
W> protected String
protected WebsocketEndpointManager
protected Server
protected WebsocketContextFactory<W>
protected W
getWebsocketPeerContext
(String peerId) void
The endpoint is actually closed by the server.void
onPeerClosed
(String peerId) A peer closed its connection.void
onPeerConnected
(String peerId) Called when the connection is established with a peer.void
onPeerMessage
(String peerId, byte[] message) A bytes messages arrives from a peer.void
onPeerMessage
(String peerId, String message) A String message arrives from a peer.
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
WebsocketEndpointHandlerDefault
public WebsocketEndpointHandlerDefault(String endpointId, WebsocketController<R, W> controller, WebsocketContextFactory<W> websocketContextFactory, Server server) Constructor
-
-
Method Details
-
getEndpointId
-
getController
-
getServer
-
getEndpointManager
-
getWebsocketContextFactory
-
getPeerContextesMap
-
getWebsocketPeerContext
-
onPeerConnected
Description copied from interface:WebsocketEndpointHandler
Called when the connection is established with a peer.- Specified by:
onPeerConnected
in interfaceWebsocketEndpointHandler
-
onPeerMessage
Description copied from interface:WebsocketEndpointHandler
A String message arrives from a peer.- Specified by:
onPeerMessage
in interfaceWebsocketEndpointHandler
-
onPeerMessage
Description copied from interface:WebsocketEndpointHandler
A bytes messages arrives from a peer.- Specified by:
onPeerMessage
in interfaceWebsocketEndpointHandler
-
onEndpointClosed
public void onEndpointClosed()Description copied from interface:WebsocketEndpointHandler
The endpoint is actually closed by the server.- Specified by:
onEndpointClosed
in interfaceWebsocketEndpointHandler
-
onPeerClosed
Description copied from interface:WebsocketEndpointHandler
A peer closed its connection.- Specified by:
onPeerClosed
in interfaceWebsocketEndpointHandler
-
createWebsocketPeerManager
Creates a peer specific manager from the endpoint manager.
-