Class DefaultSeeqWsConnectionPool

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

public class DefaultSeeqWsConnectionPool extends com.seeq.link.sdk.BaseConnection implements SeeqWsConnectionPool
Handles a pool of WebSocket-based connections to the Seeq Application Server.
  • Nested Class Summary

    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
    DefaultSeeqWsConnectionPool(String linkURL, LoginAuthManager loginAuthManager, CertificateHandler certHandler, boolean isRemoteAgent, String agentIdentification, com.seeq.link.sdk.interfaces.SeeqApiProvider apiProvider)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    void
     
    protected void
     
    protected String
     
    com.seeq.link.sdk.utilities.Event<SeeqWsConnection.MessageReceivedEventArgs>
    Event to handle the reception of messages from the Seeq Application Server.
    void
     
    protected void
     
    void
    onWebSocketChangeState(com.seeq.link.sdk.interfaces.Connection.ConnectionState newState)
    Handler called when a connection in the pool changed its state.
    void
    Handler called when a connection received a message
    boolean
    sendMessage(byte[] message)
    Sends a set of bytes to the Seeq server.

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

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, 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

    • DefaultSeeqWsConnectionPool

      public DefaultSeeqWsConnectionPool(String linkURL, LoginAuthManager loginAuthManager, CertificateHandler certHandler, boolean isRemoteAgent, String agentIdentification, com.seeq.link.sdk.interfaces.SeeqApiProvider apiProvider)
  • Method Details

    • getConnectionId

      protected String getConnectionId()
      Specified by:
      getConnectionId in class com.seeq.link.sdk.BaseConnection
    • 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
    • connect

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

      public void onWebsocketMessageReceived(Object sender, SeeqWsConnection.MessageReceivedEventArgs messageReceivedEventArgs)
      Description copied from interface: SeeqWsConnectionPool
      Handler called when a connection received a message
      Specified by:
      onWebsocketMessageReceived in interface SeeqWsConnectionPool
      Parameters:
      sender - The sender of the event
      messageReceivedEventArgs - The message received
    • monitor

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

      protected void disconnect()
      Specified by:
      disconnect 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
    • 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
    • onWebSocketChangeState

      public void onWebSocketChangeState(com.seeq.link.sdk.interfaces.Connection.ConnectionState newState)
      Description copied from interface: SeeqWsConnectionPool
      Handler called when a connection in the pool changed its state.
      Specified by:
      onWebSocketChangeState in interface SeeqWsConnectionPool
      Parameters:
      newState - - new state of the connection