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

public class DefaultAgent extends com.seeq.link.sdk.Configurable<AgentConfigV1> implements Agent
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 Details

    • DefaultAgent

      public DefaultAgent()
  • Method Details

    • getSeeqServerURL

      public String getSeeqServerURL()
      Specified by:
      getSeeqServerURL in interface com.seeq.link.sdk.interfaces.AgentService
    • getDisplayName

      public String getDisplayName()
      The display name of the Agent
      Specified by:
      getDisplayName in interface com.seeq.link.sdk.interfaces.AgentService
    • getAgentIdentification

      public String getAgentIdentification()
      Specified by:
      getAgentIdentification in interface com.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 interface com.seeq.link.sdk.interfaces.AgentService
    • getIndexingApiProvider

      public com.seeq.link.sdk.interfaces.SeeqApiProvider getIndexingApiProvider()
      Specified by:
      getIndexingApiProvider in interface com.seeq.link.sdk.interfaces.AgentService
    • getConnectors

      public Iterable<com.seeq.link.sdk.interfaces.Connector> getConnectors()
      The set of connectors that have been loaded. Disabled connectors will be in this list, even though they have not been initialized.
    • setWatchdog

      public void setWatchdog(Watchdog watchdog)
    • getName

      public String getName()
      The name of the Agent, which is used in various communications and as the name of configuration file.
      Specified by:
      getName in class com.seeq.link.sdk.Configurable<AgentConfigV1>
    • getExportTaskScheduler

      public com.seeq.link.sdk.export.ExportTaskScheduler getExportTaskScheduler()
      Specified by:
      getExportTaskScheduler in interface com.seeq.link.sdk.interfaces.AgentService
    • resolveSecret

      public String resolveSecret(String secretInputString)
      Specified by:
      resolveSecret in interface com.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 interface Agent
      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 data
      globalFolder - The path of the data folder for configuration, logs, and Seeq data
      isRemoteAgent - True if this agent is a remote agent that should use compression
      remoteAppender - 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 remotely
      seeqExternalUrl - 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 interface Agent
      Overrides:
      destroy in class com.seeq.link.sdk.Configurable<AgentConfigV1>
    • isSeeqServerConnected

      public boolean isSeeqServerConnected()
      Specified by:
      isSeeqServerConnected in interface com.seeq.link.sdk.interfaces.AgentService
    • getConnections

      public List<com.seeq.link.sdk.interfaces.DatasourceConnection> 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 interface Agent
      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 interface com.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 interface com.seeq.link.sdk.interfaces.AgentService
    • createBatchSizeHelper

      public com.seeq.link.sdk.utilities.BatchSizeHelper createBatchSizeHelper()
      Specified by:
      createBatchSizeHelper in interface com.seeq.link.sdk.interfaces.AgentService
    • createBatchSizeHelper

      public com.seeq.link.sdk.utilities.BatchSizeHelper createBatchSizeHelper(int initialSize, Duration maximumDuration)
      Specified by:
      createBatchSizeHelper in interface com.seeq.link.sdk.interfaces.AgentService
    • onConfigChanged

      protected void onConfigChanged()
      Overrides:
      onConfigChanged in class com.seeq.link.sdk.Configurable<AgentConfigV1>
    • requestRestart

      public void requestRestart()
      Specified by:
      requestRestart in interface com.seeq.link.sdk.interfaces.AgentService
    • requestIndex

      public void requestIndex(com.seeq.link.sdk.interfaces.DatasourceConnection connection)
      Specified by:
      requestIndex in interface com.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 interface com.seeq.link.sdk.interfaces.AgentService
    • markConnectionsAsReinitialized

      public void markConnectionsAsReinitialized(Collection<String> connectionIds)
      Specified by:
      markConnectionsAsReinitialized in interface com.seeq.link.sdk.interfaces.AgentService