Class ConnectorV2Host

java.lang.Object
com.seeq.link.sdk.ConnectorV2Host
All Implemented Interfaces:
Connector, ConnectorServiceV2

public class ConnectorV2Host extends Object implements Connector, ConnectorServiceV2
Hosts an IConnectorV2-based connector and acts as a bridge to the older IConnector interface via the IConnectorServiceV2 interface.
  • Constructor Details

    • ConnectorV2Host

      public ConnectorV2Host(ConnectorV2 connector)
  • Method Details

    • log

      public org.slf4j.Logger log()
      Description copied from interface: ConnectorServiceV2
      Prints diagnostic messages to the Seeq agent log file (and the console). The logging facility used is Logback. The log file is in the Seeq data folder: "log/jvm-link/jvm-link.log". When using the Debugging Agent, logs are only sent to the debug console.
      Specified by:
      log in interface ConnectorServiceV2
      Returns:
      logging facility
    • getName

      public String getName()
      Description copied from interface: Connector
      The name of the connector, as determined by the connector. This String may contain a unique identifier for the external database that is being connected to.
      Specified by:
      getName in interface Connector
      Returns:
      the name
    • getConnections

      public List<DatasourceConnection> getConnections()
      Description copied from interface: Connector
      Get all the connections that this connector has made.
      Specified by:
      getConnections in interface Connector
      Returns:
      A Collection of connections.
    • getConnectionStateChangedEvent

      public Event<Connection.StateChangedEventArgs> getConnectionStateChangedEvent()
      Description copied from interface: Connector
      Event for state changes of the connector's connection(s).
      Specified by:
      getConnectionStateChangedEvent in interface Connector
      Returns:
      the state changed event
    • determineServices

      public static AgentMessages.DatasourceService[] determineServices(DatasourceConnectionV2 connection)
    • addConnection

      public void addConnection(DatasourceConnectionV2 connection)
      Description copied from interface: ConnectorServiceV2
      Must be used when connections are established to external systems. Note: This function is used even if connections are disabled.
      Specified by:
      addConnection in interface ConnectorServiceV2
      Parameters:
      connection - The connection being established.
    • getAgentService

      public AgentService getAgentService()
      Description copied from interface: ConnectorServiceV2
      Retrieves the agent service that can be used to access the REST API directly, among other things.
      Specified by:
      getAgentService in interface ConnectorServiceV2
      Returns:
      The agent service.
    • initialize

      public void initialize(AgentService agentService) throws Exception
      Description copied from interface: Connector
      Initializes a connector with the agent service interface it will use to communicate to Seeq Server. The implementation of this function can choose to automatically establish connections based on a global registry (like the PI "Known Servers Table").
      Specified by:
      initialize in interface Connector
      Parameters:
      agentService - The agent that is hosting this connector.
      Throws:
      Exception - Thrown if connector had an issue initializing.
    • destroy

      public void destroy()
      Description copied from interface: Connector
      Performs cleanup of a connector as necessary, removing all connections and releasing all resources.
      Specified by:
      destroy in interface Connector
    • processMessage

      public boolean processMessage(String destinationConnectorInstanceId, AgentMessages.DataDocument document)
      Description copied from interface: Connector
      Called by an Agent when a data document is received from Seeq Server. It is the connector's responsibility to determine whether to handle the document.
      Specified by:
      processMessage in interface Connector
      Parameters:
      destinationConnectorInstanceId - A connector-specific identifier used to route the message within the connector.
      document - The message payload.
      Returns:
      true if the message was processed by the connector, false if it was ignored
    • loadConfig

      public ConfigObject loadConfig(ConfigObject[] supportedObjects) throws IOException
      Description copied from interface: ConnectorServiceV2
      Reads the configuration object from disk from the expected location (configuration/link within the data folder).
      Specified by:
      loadConfig in interface ConnectorServiceV2
      Parameters:
      supportedObjects - An array of object types to try loading. If the config file is not present, or none of the class types could successfully serialize the JSON, then the first item in the array is returned. This serves as mechanism for providing the "default" config object class.
      Returns:
      The serialized config object, or the first item in supportedObjects.
      Throws:
      IOException - Thrown if there is a problem reading the configuration file
    • saveConfig

      public void saveConfig()
      Description copied from interface: Connector
      Called by a connection when it wants its configuration saved.
      Specified by:
      saveConfig in interface Connector
    • saveConfig

      public void saveConfig(ConfigObject configObject)
      Description copied from interface: ConnectorServiceV2
      Writes the configuration object to disk in the expected location (configuration/link within the data folder).
      Specified by:
      saveConfig in interface ConnectorServiceV2
      Parameters:
      configObject - The configuration object to write
    • setConnectorDeveloperName

      public void setConnectorDeveloperName(String connectorDeveloperName)
      Description copied from interface: ConnectorServiceV2
      This should be called by Connectors in the beginning of initialize() to set the developer's name. This name is displayed in the user interface so users know who to contact when they need support.
      Specified by:
      setConnectorDeveloperName in interface ConnectorServiceV2
    • setConnectorDeveloperSupportUrl

      public void setConnectorDeveloperSupportUrl(String connectorDeveloperSupportUrl)
      Description copied from interface: ConnectorServiceV2
      This should be called by Connectors in the beginning of initialize() to set the developer's support URL. This URL is displayed in the user interface so users know who to contact when they need support.
      Specified by:
      setConnectorDeveloperSupportUrl in interface ConnectorServiceV2
    • getConnectorDeveloperName

      public String getConnectorDeveloperName()
      Specified by:
      getConnectorDeveloperName in interface ConnectorServiceV2
      Returns:
      the name of the connector's developer, as set by setConnectorDeveloperName().
    • getConnectorDeveloperSupportUrl

      public String getConnectorDeveloperSupportUrl()
      Specified by:
      getConnectorDeveloperSupportUrl in interface ConnectorServiceV2
      Returns:
      the support URL of the connector's developer, as set by setConnectorDeveloperSupportUrl().