Package com.jbstrap.core.websocket
Class JBStrapEndPoint
java.lang.Object
com.jbstrap.core.websocket.JBStrapEndPoint
- Since:
- 4.0
- Author:
- JBStrap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final Collection<Client>Get all connected clientstatic StringGet application base URLstatic ClientGet the client by client idstatic Component<?>getComponentById(String componentId) Get component by id from the all clientstatic CurrentUsergetUserFromUUID(String userUUID) Get user object from user unique IDvoidonClose(javax.websocket.Session session) Close WebSocket channelvoidError in WebSocket communicationvoidReceive message from WebSocketvoidonOpen(javax.websocket.Session session, javax.websocket.EndpointConfig config) Open WebSocket channelprotected static voidremoveClient(String clientId) Remove client from the serverstatic voidExecute 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
nullif 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
nullif 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
-