Class JBStrapEndPoint

java.lang.Object
com.jbstrap.core.websocket.JBStrapEndPoint

public class JBStrapEndPoint extends Object
Since:
4.0
Author:
JBStrap
  • 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

      public void onMessage(javax.websocket.Session session, BaseEvent event) throws IOException
      Receive message from WebSocket
      Parameters:
      session - The WbSocket session
      event - The received message
      Throws:
      IOException - IOException
    • onClose

      public void onClose(javax.websocket.Session session) throws IOException
      Close WebSocket channel
      Parameters:
      session - The closed sesssion
      Throws:
      IOException - IOException
    • onError

      public void onError(javax.websocket.Session session, Throwable throwable)
      Error in WebSocket communication
      Parameters:
      session - The WebSocket session
      throwable - The catched exception
    • getAllClients

      public static final Collection<Client> getAllClients()
      Get all connected client
      Returns:
      Collection of the all connected client
    • removeClient

      protected static void removeClient(String clientId)
      Remove client from the server
      Parameters:
      clientId - The removable client id
    • getClient

      public static Client getClient(String clientId)
      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

      public static Component<?> getComponentById(String componentId)
      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

      public static CurrentUser getUserFromUUID(String userUUID)
      Get user object from user unique ID
      Parameters:
      userUUID - The user unique ID
      Returns:
      THe user object or null, if user not found
    • getBaseURL

      public static String 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