Package com.seeq.link.sdk.interfaces
Interface Connection
- All Known Subinterfaces:
DatasourceConnection
- All Known Implementing Classes:
BaseConnection
,DatasourceConnectionV2Host
public interface Connection
Provides methods for establishing, monitoring and disabling connections to external systems. The external system may
be a connector datasource (and therefore an
DatasourceConnection
) or the Seeq Server (SeeqConnection).-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
The set of possible connection states to an external entity.static class
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Disconnects from external systems and kills the monitoring thread.void
disable()
Disable connections to the server.void
enable()
Enable connection and call the connect() method.A summary of the connection status, including any connection failure reason.Maximum time to delay a reconnect attempt.Time to wait before reconnecting.Time between testing of the connection vitality.getState()
The current state of the connection.Event for state changes of the connection.void
Initializes a connection, attempting to connect if enabled.void
setMaxReconnectDelay
(Duration value) Maximum time to delay a reconnect attempt.void
setMinReconnectDelay
(Duration value) Time to wait before reconnecting.void
setMonitorPeriod
(Duration value) Time between testing of the connection vitality.
-
Method Details
-
initialize
void initialize()Initializes a connection, attempting to connect if enabled. -
destroy
void destroy()Disconnects from external systems and kills the monitoring thread. -
getConnectionMessage
String getConnectionMessage()A summary of the connection status, including any connection failure reason.- Returns:
- summary of the connection status, including any connection failure reason.
-
getMinReconnectDelay
Duration getMinReconnectDelay()Time to wait before reconnecting. Default is 5 seconds. There is an "exponential backoff" algorithm at play that will increase the reconnect delay as repeated attempts fail. That's why this is the minimum delay.- Returns:
- minimum reconnect delay
-
setMinReconnectDelay
Time to wait before reconnecting. Default is 5 seconds. There is an "exponential backoff" algorithm at play that will increase the reconnect delay as repeated attempts fail. That's why this is the minimum delay.- Parameters:
value
- minimum reconnect delay
-
getMaxReconnectDelay
Duration getMaxReconnectDelay()Maximum time to delay a reconnect attempt. Default is 5 minutes. There is an "exponential backoff" algorithm at play that will increase the reconnect delay as repeated attempts fail.- Returns:
- maximum reconnect delay
-
setMaxReconnectDelay
Maximum time to delay a reconnect attempt. Default is 5 minutes. There is an "exponential backoff" algorithm at play that will increase the reconnect delay as repeated attempts fail.- Parameters:
value
- maximum reconnect delay
-
getState
Connection.ConnectionState getState()The current state of the connection.- Returns:
- state of the connection
-
getStateChangedEvent
Event<Connection.StateChangedEventArgs> getStateChangedEvent()Event for state changes of the connection.- Returns:
- the state changed event
-
enable
void enable()Enable connection and call the connect() method. The connection will pass through a Connecting state first. -
disable
void disable()Disable connections to the server. This calls the disconnect() method in the derived class. Reconnections will not occur if/until a Connect() call is made. -
getMonitorPeriod
Duration getMonitorPeriod()Time between testing of the connection vitality. Default should be 5 seconds.- Returns:
- the monitor period
-
setMonitorPeriod
Time between testing of the connection vitality. Default should be 5 seconds.- Parameters:
value
- - the new monitor period
-