Class IndexingSchedule

java.lang.Object
com.seeq.link.sdk.IndexingSchedule

public class IndexingSchedule extends Object
Captures the intended schedule for a connection's indexing activity. getNext() specifies the next scheduled indexing time, with timezone information. getFrequency() indicates how frequent indexing should occur. This class honors timezone peculiarities, so that a frequency of 1d is ensured to be at the same time of day regardless of daylight savings time and whatnot. isOnStartupAndConfigChange() indicates whether indexing will occur when the agent starts and when the connection's configuration changes. All scheduling captured by this class is for SyncMode.FULL indexing. Connections are responsible for triggering SyncMode.INCREMENTAL indexing activity according to their own requirements. (The Stress Test Connector is an example of how a connection might do it.) Connections will call requestNow(SyncMode) when they want to trigger an index themselves.
  • Constructor Details

    • IndexingSchedule

      public IndexingSchedule()
    • IndexingSchedule

      public IndexingSchedule(ZonedDateTime next, String frequency, boolean onStartupAndConfigChange)
  • Method Details

    • getNext

      public String getNext()
      Returns the time of the next scheduled indexing activity as a fully-qualified ISO 8601 string with time zone info.
      Returns:
      the time of the next scheduled indexing activity
    • setNext

      public void setNext(String next)
      Called by the JSON deserializer when reading in the schedule from disk.
      Parameters:
      next - the time of the next scheduled indexing activity
    • shouldIndex

      public SyncMode shouldIndex(String connectionName)
      Called by the agent to determine if this connection should index. An index may be triggered due to scheduling, startup/config change, or as a result of a request from the connection.
      Parameters:
      connectionName - The name of this connection. Used solely for logging purposes.
      Returns:
      The SyncMode desired. This will always be SyncMode.FULL unless the connection has requested an SyncMode.INCREMENTAL.
    • requestNow

      public void requestNow(SyncMode syncMode)
      Called by a connection to request an index right now. This is the method by which an SyncMode.INCREMENTAL index can happen.
      Parameters:
      syncMode - The indexing mode requested
    • markIndexingFinished

      public void markIndexingFinished()
      Called by the agent when indexing has finished.