Package com.jbstrap.core.websocket
Class JBStrapEndPoint
java.lang.Object
com.jbstrap.core.websocket.JBStrapEndPoint
- Since:
- 4.0
- Author:
- JBStrap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final Collection<Client>
Get all connected clientstatic String
Get application base URLstatic Client
Get the client by client idstatic Component<?>
getComponentById
(String componentId) Get component by id from the all clientstatic CurrentUser
getUserFromUUID
(String userUUID) Get user object from user unique IDvoid
onClose
(javax.websocket.Session session) Close WebSocket channelvoid
Error in WebSocket communicationvoid
Receive message from WebSocketvoid
onOpen
(javax.websocket.Session session, javax.websocket.EndpointConfig config) Open WebSocket channelprotected static void
removeClient
(String clientId) Remove client from the serverstatic void
Execute JavaScript batch on the client(s) from the soecifed thread
-
Constructor Details
-
JBStrapEndPoint
public JBStrapEndPoint()
-
-
Method Details
-
onOpen
public void onOpen(javax.websocket.Session session, javax.websocket.EndpointConfig config) throws IOException Open WebSocket channel- Parameters:
session
- The WebSocket seccion- Throws:
IOException
-IOException
-
onMessage
Receive message from WebSocket- Parameters:
session
- The WbSocket sessionevent
- The received message- Throws:
IOException
-IOException
-
onClose
Close WebSocket channel- Parameters:
session
- The closed sesssion- Throws:
IOException
-IOException
-
onError
Error in WebSocket communication- Parameters:
session
- The WebSocket sessionthrowable
- The catched exception
-
getAllClients
Get all connected client- Returns:
- Collection of the all connected client
-
removeClient
Remove client from the server- Parameters:
clientId
- The removable client id
-
getClient
Get the client by client id- Parameters:
clientId
- The client id- Returns:
- The client object or
null
if not found client with specified id
-
getComponentById
Get component by id from the all client- Parameters:
componentId
- The component unique id- Returns:
- The component eor
null
if not found component by specified id
-
getUserFromUUID
Get user object from user unique ID- Parameters:
userUUID
- The user unique ID- Returns:
- THe user object or
null
, if user not found
-
getBaseURL
Get application base URL- Returns:
- The application base URL
-
threadDone
public static void threadDone()Execute JavaScript batch on the client(s) from the soecifed thread
-