Class DatasourceQuerySink
java.lang.Object
com.inductiveautomation.ignition.gateway.storeforward.sinks.AbstractSink<T>
com.inductiveautomation.ignition.gateway.storeforward.sinks.AbstractDatasourceSink<QuerySFData>
com.inductiveautomation.ignition.gateway.datasource.storage.DatasourceQuerySink
- All Implemented Interfaces:
DataConsumer<QuerySFData>,DataSink<QuerySFData>
A sink that executes queries to a datasource.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.gateway.storeforward.sinks.AbstractSink
AbstractSink.SinkWriter -
Field Summary
Fields inherited from class com.inductiveautomation.ignition.gateway.storeforward.sinks.AbstractDatasourceSink
datasourceName, queryCacheFields inherited from class com.inductiveautomation.ignition.gateway.storeforward.sinks.AbstractSink
batchSize, flavor, id, status, storeMetric -
Constructor Summary
ConstructorsConstructorDescriptionDatasourceQuerySink(GatewayContext context, String dataSource) Creates a new instance of this sink with the specified context and datasource. -
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull LocalizedStringprotected voidstoreToConnection(SRConnection conn, List<QuerySFData> querySFData) Stores the given data to the specified connection.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 class com.inductiveautomation.ignition.gateway.storeforward.sinks.AbstractDatasourceSink
getDatasource, getQueryCache, isDatasourceAvailable, onInitialize, onShutdown, onStartup, onStorageFailure, onUninitialize, runFirstTimeChecks, storeData, storeToDatasource, useBatchingMethods inherited from class com.inductiveautomation.ignition.gateway.storeforward.sinks.AbstractSink
createLogger, getContext, getFaultError, getInfo, getLogger, getMetricPrefix, getStorageKey, getSupportedFlavor, getWriter, initialize, isAccepting, markStoreMetric, onFailure, shutdown, startup, toString, uninitialize, updateStatus, validateFlavorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.inductiveautomation.ignition.gateway.storeforward.DataConsumer
storeDataMethods inherited from interface com.inductiveautomation.ignition.gateway.storeforward.sinks.DataSink
isEngineBound
-
Constructor Details
-
DatasourceQuerySink
Creates a new instance of this sink with the specified context and datasource. The default flavor forQuerySFDatawill be used as the sink's supported flavor.- Parameters:
context- the gateway contextdataSource- the data source to execute the underling queries withinQuerySFData
-
-
Method Details
-
storeToConnection
Description copied from class:AbstractDatasourceSinkStores the given data to the specified connection.- Specified by:
storeToConnectionin classAbstractDatasourceSink<QuerySFData>- Parameters:
conn- the connection to store the data toquerySFData- the data to be stored- Throws:
Exception- if there is an error storing the data
-
getTypeDescription
- Specified by:
getTypeDescriptionin classAbstractSink<QuerySFData>
-
withStorageKey
Description copied from interface:DataSinkCreates 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
-