Package com.seeq.link.sdk.interfaces
Interface Connector
- All Known Implementing Classes:
ConnectorV2Host
public interface Connector
A connector handles configuration and creation of connections.
Connectors are loaded via the ServiceLoader
mechanism. They need to be registered
under META-INF/services/com.seeq.link.sdk.interfaces.Connector
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Performs cleanup of a connector as necessary, removing all connections and releasing all resources.Get all the connections that this connector has made.Event for state changes of the connector's connection(s).getName()
The name of the connector, as determined by the connector.void
initialize
(AgentService agentService) Initializes a connector with the agent service interface it will use to communicate to Seeq Server.boolean
processMessage
(String destinationConnectorInstanceId, AgentMessages.DataDocument document) Called by an Agent when a data document is received from Seeq Server.void
Called by a connection when it wants its configuration saved.
-
Method Details
-
getName
String getName()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.- Returns:
- the name
-
initialize
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").- Parameters:
agentService
- The agent that is hosting this connector.- Throws:
Exception
- Thrown if connector had an issue initializing.
-
destroy
void destroy()Performs cleanup of a connector as necessary, removing all connections and releasing all resources. -
getConnections
List<DatasourceConnection> getConnections()Get all the connections that this connector has made.- Returns:
- A Collection of connections.
-
getConnectionStateChangedEvent
Event<Connection.StateChangedEventArgs> getConnectionStateChangedEvent()Event for state changes of the connector's connection(s).- Returns:
- the state changed event
-
processMessage
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.- 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
-
saveConfig
void saveConfig()Called by a connection when it wants its configuration saved.
-