Interface DataSink<T extends PersistentData>
- Type Parameters:
T- a subclass ofPersistentData
- All Superinterfaces:
DataConsumer<T>
- All Known Subinterfaces:
DataStore<T>
- All Known Implementing Classes:
AbstractDatasourceSink,AbstractSink,DatasourceQuerySink,HistoricalRecordSink,TagHistoryDataSinkBridge
-
Method Summary
Modifier and TypeMethodDescriptiongetInfo()Returns descriptive information about this data sink.Returns the flavor of data that the data sink supports.Gets a writer object for writing to the data sink.booleanDetermines whether the data sink is currently accepting data.default booleanIndicates whether this sink is bound to its engine's lifecycle.default voidshutdown()Shuts down the data sink.default voidstartup()Starts up the data sink.withStorageKey(StorageKey storageKey, boolean matchPruning) Creates a new, independent sink of this type bound to the given storage key, reusing this sink's configuration.Methods inherited from interface com.inductiveautomation.ignition.gateway.storeforward.DataConsumer
storeData, storeData, validateFlavor
-
Method Details
-
startup
default void startup()Starts up the data sink. -
shutdown
default void shutdown()Shuts down the data sink. -
isEngineBound
default boolean isEngineBound()Indicates whether this sink is bound to its engine's lifecycle.Engine-bound sinks (like
DatasourceQuerySink) are inherently tied to their engine (typically a datasource). When the engine is renamed, both the engineId and sinkId will be updated with an associatedEngineManifest.Independent sinks (like ones created from external providers) have their own identity separate from the engine. When the engine is renamed, only the engineId is updated; the sinkId remains intact.
The default implementation returns
trueifengineId.equals(sinkId)(theStorageKey.repeated(String)pattern), which is appropriate for most datasource-bound sinks. Override this method to returnfalsefor sinks that have independent identities even when their sinkId happens to match the engineId.- Returns:
trueif this sink is bound to the engine's lifecycle,falseif it has an independent identity- Since:
- 8.3.4
-
getInfo
DataSinkInformation getInfo()Returns descriptive information about this data sink.- Returns:
- the descriptive information pertaining to this data sink
-
isAccepting
boolean isAccepting()Determines whether the data sink is currently accepting data.- Returns:
- true if the data sink is accepting data, false otherwise
-
getSupportedFlavor
PersistentFlavor<T> getSupportedFlavor()Returns the flavor of data that the data sink supports.- Returns:
- a
PersistentFlavorobject representing the supported flavor
-
getWriter
BatchWriter<T> getWriter()Gets a writer object for writing to the data sink. This can be used for batching data together when writing.- Returns:
- a
BatchWriterobject for writing to the data sink
-
withStorageKey
Creates a new, independent sink of this type bound to the given storage key, reusing this sink's configuration. The new sink writes to the datasource named byStorageKey.engineId()of the supplied key, allowing data to be forwarded through a duplicate datasource without disturbing this (original) sink.The default implementation returns empty, indicating this sink type does not support copies (for example remote sinks, which forward to another gateway rather than a database). Datasource-backed sinks override this to reconstruct themselves against
storageKey, carrying over their settings.- Parameters:
storageKey- the storage key the new sink should be bound tomatchPruning- if the sink supports pruning, request that it match this sinks settings, otherwise disable pruning- Returns:
- a new sink bound to
storageKey, or empty if this sink type cannot be backfilled - Since:
- 8.3.9
-