Class WebXClient

java.lang.Object
eu.ill.webx.relay.WebXClient

public class WebXClient extends Object
Provides a connection point between specific web client and a session. Messages from the WebXEngine are stored in the messageQueue and read manually from client applications (via the WebXTunnel).
  • Method Details

    • getClientIdentifier

      public ClientIdentifier getClientIdentifier()
      Returns the client identifier
      Returns:
      the client identifier
    • getSessionId

      public SessionId getSessionId()
      Returns the session Id
      Returns:
      the session Id
    • onDisconnected

      public void onDisconnected()
      Called by the session when the client is disconneted. This sends a message to the message queue to unblock any calls that are active to the getMessage method
    • isConnected

      public boolean isConnected()
      Returns true if state is connected
      Returns:
      true if state is connected
    • onMessage

      public void onMessage(byte[] messageData)
      Called when a message from the server is destined to this client. Queues a new Message object
      Parameters:
      messageData - the raw message data
    • sendInstruction

      public void sendInstruction(byte[] instructionData)
      Sends a message to the instruction publisher. The instruction data is prefixed with the session Id and client Id.
      Parameters:
      instructionData - the binary instruction data from the client
    • getMessage

      Blocking method, waiting for a message to be sent from the server. Messages from the server are queued by a separate thread.
      Returns:
      the raw binary message from the engine
      Throws:
      WebXClientException - thrown if the client is in error
      WebXConnectionInterruptException - thrown if the connection is interrupted
      WebXDisconnectedException - thrown if disconnected