Class DefaultSeeqWsConnection

java.lang.Object
com.seeq.link.sdk.BaseConnection
com.seeq.link.agent.DefaultSeeqWsConnection
All Implemented Interfaces:
SeeqWsConnection, com.seeq.link.sdk.interfaces.Connection

@WebSocket public class DefaultSeeqWsConnection extends com.seeq.link.sdk.BaseConnection implements SeeqWsConnection
Handles a WebSocket-based connection to the Seeq Application Server.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from interface com.seeq.link.sdk.interfaces.Connection

    com.seeq.link.sdk.interfaces.Connection.ConnectionState, com.seeq.link.sdk.interfaces.Connection.StateChangedEventArgs

    Nested classes/interfaces inherited from interface com.seeq.link.agent.interfaces.SeeqWsConnection

    SeeqWsConnection.MessageReceivedEventArgs
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     

    Fields inherited from class com.seeq.link.sdk.BaseConnection

    lastException
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultSeeqWsConnection(SeeqWsConnectionPool pool, int poolMemberIndex, String linkURL, LoginAuthManager loginAuthManager, CertificateHandler certHandler, boolean isRemoteAgent, String agentIdentification, ExecutorService incomingMessageThreadPool, ExecutorService outgoingMessageThreadPool)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Handles the act of connecting to the Seeq Application Server.
    void
     
    protected void
    Disconnect from Seeq Application Server and ensure socket has been closed.
    boolean
     
    The connection String for the Seeq Application Server.
    com.seeq.link.sdk.utilities.Event<SeeqWsConnection.MessageReceivedEventArgs>
    Event to handle the reception of messages from the Seeq Application Server.
    int
     
    void
     
    protected void
     
    void
    onSocketClose(int statusCode, String reason)
     
    void
    onSocketError(org.eclipse.jetty.websocket.api.Session session, Throwable cause)
     
    void
    onSocketMessage(byte[] buffer, int offset, int length)
     
    void
    onSocketOpen(org.eclipse.jetty.websocket.api.Session session)
     
    boolean
    sendMessage(byte[] message)
    Sends a set of bytes to the Seeq server.
    protected void
    setState(com.seeq.link.sdk.interfaces.Connection.ConnectionState newState, String message)
     

    Methods inherited from class com.seeq.link.sdk.BaseConnection

    disable, enable, getBackgroundThreads, getConnectionMessage, getLastException, getMaxReconnectDelay, getMinReconnectDelay, getMonitorPeriod, getState, getStateChangedEvent, handleConnectionMonitorException, setMaxReconnectDelay, setMinReconnectDelay, setMonitorPeriod

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.seeq.link.sdk.interfaces.Connection

    disable, enable, getConnectionMessage, getMaxReconnectDelay, getMinReconnectDelay, getMonitorPeriod, getState, getStateChangedEvent, setMaxReconnectDelay, setMinReconnectDelay, setMonitorPeriod
  • Field Details

    • INCOMING_MESSAGE_THREAD_POOL_SIZE

      public static final int INCOMING_MESSAGE_THREAD_POOL_SIZE
      See Also:
  • Constructor Details

  • Method Details

    • getMessageReceivedEvent

      public com.seeq.link.sdk.utilities.Event<SeeqWsConnection.MessageReceivedEventArgs> getMessageReceivedEvent()
      Description copied from interface: SeeqWsConnection
      Event to handle the reception of messages from the Seeq Application Server.
      Specified by:
      getMessageReceivedEvent in interface SeeqWsConnection
      Returns:
      the agent message received event
    • initialize

      public void initialize()
      Specified by:
      initialize in interface com.seeq.link.sdk.interfaces.Connection
      Specified by:
      initialize in class com.seeq.link.sdk.BaseConnection
    • destroy

      public void destroy()
      Specified by:
      destroy in interface com.seeq.link.sdk.interfaces.Connection
      Specified by:
      destroy in class com.seeq.link.sdk.BaseConnection
    • sendMessage

      public boolean sendMessage(byte[] message)
      Description copied from interface: SeeqWsConnection
      Sends a set of bytes to the Seeq server.
      Specified by:
      sendMessage in interface SeeqWsConnection
      Parameters:
      message - The set of bytes to be sent
      Returns:
      True if message was sent successfully
    • connect

      protected void connect()
      Handles the act of connecting to the Seeq Application Server.
      Specified by:
      connect in class com.seeq.link.sdk.BaseConnection
    • monitor

      protected void monitor()
      Specified by:
      monitor in class com.seeq.link.sdk.BaseConnection
    • disconnect

      protected void disconnect()
      Disconnect from Seeq Application Server and ensure socket has been closed.
      Specified by:
      disconnect in class com.seeq.link.sdk.BaseConnection
    • onSocketOpen

      @OnWebSocketConnect public void onSocketOpen(org.eclipse.jetty.websocket.api.Session session)
    • onSocketClose

      @OnWebSocketClose public void onSocketClose(int statusCode, String reason)
    • onSocketMessage

      @OnWebSocketMessage public void onSocketMessage(byte[] buffer, int offset, int length)
    • onSocketError

      @OnWebSocketError public void onSocketError(org.eclipse.jetty.websocket.api.Session session, Throwable cause)
    • getConnectionId

      public String getConnectionId()
      The connection String for the Seeq Application Server. This is the same as the URL property.
      Specified by:
      getConnectionId in class com.seeq.link.sdk.BaseConnection
    • setState

      protected void setState(com.seeq.link.sdk.interfaces.Connection.ConnectionState newState, String message)
      Overrides:
      setState in class com.seeq.link.sdk.BaseConnection
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object