Package com.seeq.link.agent
Class DefaultAgent
java.lang.Object
com.seeq.link.sdk.Configurable<AgentConfigV1>
com.seeq.link.agent.DefaultAgent
- All Implemented Interfaces:
Agent
,com.seeq.link.sdk.interfaces.AgentService
The Agent performs the following duties:
- Establish a connection to the Seeq Server (the 'linkURL') via the passed-in Connection Object
- Load and initialize connectors via the passed-in ConnectorLoader Object
- Supply global services to the connectors via the
AgentService
interface, which also provides access to the Seeq Server REST API
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.seeq.link.sdk.utilities.BatchSizeHelper
com.seeq.link.sdk.utilities.BatchSizeHelper
createBatchSizeHelper
(int initialSize, Duration maximumDuration) void
destroy()
Destroys all connectors and stops sending heartbeats to the Seeq Server.com.seeq.link.sdk.interfaces.SeeqApiProvider
Provides methods to construct Seeq API objects.List<com.seeq.link.sdk.interfaces.DatasourceConnection>
Provides a collection of connections, which represents the union of all connections being managed by all connectors.List<org.apache.commons.lang3.tuple.Pair<com.seeq.link.sdk.interfaces.Connector,
com.seeq.link.sdk.interfaces.DatasourceConnection>> Iterable<com.seeq.link.sdk.interfaces.Connector>
The set of connectors that have been loaded.The display name of the Agentcom.seeq.link.sdk.export.ExportTaskScheduler
com.seeq.link.sdk.interfaces.SeeqApiProvider
getName()
The name of the Agent, which is used in various communications and as the name of configuration file.void
initialize
(String name, SeeqWsConnection seeqWsConnection, SeeqHttpConnection seeqHttpConnection, ConnectorLoader connectorLoader, com.seeq.link.sdk.interfaces.ConfigService configService, Path dataFolder, Path globalFolder, boolean isRemoteAgent, RemoteAppender remoteAppender, com.seeq.link.sdk.interfaces.RemoteConfigChangeListener remoteConfigChangeListener, URL seeqExternalUrl) Agents have several dependencies, as detailed in the param documentation.boolean
void
markConnectionsAsReinitialized
(Collection<String> connectionIds) protected void
void
requestIndex
(com.seeq.link.sdk.interfaces.DatasourceConnection connection) void
requestIndex
(com.seeq.link.sdk.interfaces.DatasourceConnection connection, com.seeq.link.sdk.interfaces.SyncMode syncMode) void
resolveSecret
(String secretInputString) void
void
void
sendMessage
(com.seeq.link.sdk.interfaces.DatasourceConnection datasourceConnection, com.seeq.link.messages.agent.AgentMessages.DataDocument message) void
setWatchdog
(Watchdog watchdog) Methods inherited from class com.seeq.link.sdk.Configurable
getConfig, getConfigService, initialize, loadConfig, migrateConfig, saveConfig
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.AgentService
getConfigService, getDataFolder, getGlobalFolder, isRemoteAgent
-
Constructor Details
-
DefaultAgent
public DefaultAgent()
-
-
Method Details
-
getSeeqServerURL
- Specified by:
getSeeqServerURL
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
getDisplayName
The display name of the Agent- Specified by:
getDisplayName
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
getAgentIdentification
- Specified by:
getAgentIdentification
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
getApiProvider
public com.seeq.link.sdk.interfaces.SeeqApiProvider getApiProvider()Provides methods to construct Seeq API objects.- Specified by:
getApiProvider
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
getIndexingApiProvider
public com.seeq.link.sdk.interfaces.SeeqApiProvider getIndexingApiProvider()- Specified by:
getIndexingApiProvider
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
getConnectors
The set of connectors that have been loaded. Disabled connectors will be in this list, even though they have not been initialized. -
setWatchdog
-
getName
The name of the Agent, which is used in various communications and as the name of configuration file.- Specified by:
getName
in classcom.seeq.link.sdk.Configurable<AgentConfigV1>
-
getExportTaskScheduler
public com.seeq.link.sdk.export.ExportTaskScheduler getExportTaskScheduler()- Specified by:
getExportTaskScheduler
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
resolveSecret
- Specified by:
resolveSecret
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
initialize
public void initialize(String name, SeeqWsConnection seeqWsConnection, SeeqHttpConnection seeqHttpConnection, ConnectorLoader connectorLoader, com.seeq.link.sdk.interfaces.ConfigService configService, Path dataFolder, Path globalFolder, boolean isRemoteAgent, RemoteAppender remoteAppender, com.seeq.link.sdk.interfaces.RemoteConfigChangeListener remoteConfigChangeListener, URL seeqExternalUrl) Description copied from interface:Agent
Agents have several dependencies, as detailed in the param documentation. The initialization call will load connectors and, if they are enabled in the Agent's connector configuration (which they are by default), will initialize them. Typically, a connector will detect established connection configurations and attempt to make connections automatically, but that is dependent on the connector implementation.- Specified by:
initialize
in interfaceAgent
- Parameters:
name
- The name of the Agent, which is used in various communications and as the name of configuration file.seeqWsConnection
- The Seeq Server bi-directional connection interface.seeqHttpConnection
- The Seeq Server HTTP connection interface for communication using the API.connectorLoader
- The interface used to find and load connectors.configService
- The interface used to load configuration information.dataFolder
- The path of the data folder for configuration, logs, and Seeq dataglobalFolder
- The path of the data folder for configuration, logs, and Seeq dataisRemoteAgent
- True if this agent is a remote agent that should use compressionremoteAppender
- The remote appender to harvest log entries from. Only supply when isRemoteAgent is true.remoteConfigChangeListener
- The listener to be informed when agent / connector configuration changed remotelyseeqExternalUrl
- The URL for Seeq users. (The agent connects on the private URL.)
-
destroy
public void destroy()Description copied from interface:Agent
Destroys all connectors and stops sending heartbeats to the Seeq Server.- Specified by:
destroy
in interfaceAgent
- Overrides:
destroy
in classcom.seeq.link.sdk.Configurable<AgentConfigV1>
-
isSeeqServerConnected
public boolean isSeeqServerConnected()- Specified by:
isSeeqServerConnected
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
getConnections
Description copied from interface:Agent
Provides a collection of connections, which represents the union of all connections being managed by all connectors.- Specified by:
getConnections
in interfaceAgent
- Returns:
- The union of all connections on all connectors.
-
getConnectionsWithConnectors
public List<org.apache.commons.lang3.tuple.Pair<com.seeq.link.sdk.interfaces.Connector,com.seeq.link.sdk.interfaces.DatasourceConnection>> getConnectionsWithConnectors() -
sendAgentInfoToServer
public void sendAgentInfoToServer()- Specified by:
sendAgentInfoToServer
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
sendAgentInfoToServerInternal
public void sendAgentInfoToServerInternal() -
sendMessage
public void sendMessage(com.seeq.link.sdk.interfaces.DatasourceConnection datasourceConnection, com.seeq.link.messages.agent.AgentMessages.DataDocument message) - Specified by:
sendMessage
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
createBatchSizeHelper
public com.seeq.link.sdk.utilities.BatchSizeHelper createBatchSizeHelper()- Specified by:
createBatchSizeHelper
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
createBatchSizeHelper
public com.seeq.link.sdk.utilities.BatchSizeHelper createBatchSizeHelper(int initialSize, Duration maximumDuration) - Specified by:
createBatchSizeHelper
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
onConfigChanged
protected void onConfigChanged()- Overrides:
onConfigChanged
in classcom.seeq.link.sdk.Configurable<AgentConfigV1>
-
requestRestart
public void requestRestart()- Specified by:
requestRestart
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
requestIndex
public void requestIndex(com.seeq.link.sdk.interfaces.DatasourceConnection connection) - Specified by:
requestIndex
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
requestIndex
public void requestIndex(com.seeq.link.sdk.interfaces.DatasourceConnection connection, com.seeq.link.sdk.interfaces.SyncMode syncMode) - Specified by:
requestIndex
in interfacecom.seeq.link.sdk.interfaces.AgentService
-
markConnectionsAsReinitialized
- Specified by:
markConnectionsAsReinitialized
in interfacecom.seeq.link.sdk.interfaces.AgentService
-