Package com.seeq.link.sdk
Class IndexingSchedule
java.lang.Object
com.seeq.link.sdk.IndexingSchedule
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 Summary
ConstructorsConstructorDescriptionIndexingSchedule
(ZonedDateTime next, String frequency, boolean onStartupAndConfigChange) -
Method Summary
Modifier and TypeMethodDescriptiongetNext()
Returns the time of the next scheduled indexing activity as a fully-qualified ISO 8601 string with time zone info.void
Called by the agent when indexing has finished.void
requestNow
(SyncMode syncMode) Called by a connection to request an index right now.void
Called by the JSON deserializer when reading in the schedule from disk.shouldIndex
(String connectionName) Called by the agent to determine if this connection should index.
-
Constructor Details
-
IndexingSchedule
public IndexingSchedule() -
IndexingSchedule
-
-
Method Details
-
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
Called by the JSON deserializer when reading in the schedule from disk.- Parameters:
next
- the time of the next scheduled indexing activity
-
shouldIndex
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 beSyncMode.FULL
unless the connection has requested anSyncMode.INCREMENTAL
.
-
requestNow
Called by a connection to request an index right now. This is the method by which anSyncMode.INCREMENTAL
index can happen.- Parameters:
syncMode
- The indexing mode requested
-
markIndexingFinished
public void markIndexingFinished()Called by the agent when indexing has finished.
-