Class FilteredStreamingDatasetWriter
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.datasource.FilteredStreamingDatasetWriter
-
- All Implemented Interfaces:
StreamingDatasetWriter
public class FilteredStreamingDatasetWriter extends java.lang.Object implements StreamingDatasetWriter
This class wraps a StreamingDatasetWriter, and allows us to specify indexes or column names (case insensitive) that will be filtered from the underlying dataset.
-
-
Constructor Summary
Constructors Constructor Description FilteredStreamingDatasetWriter(StreamingDatasetWriter core, java.lang.Integer[] filteredColumnIndexes)
FilteredStreamingDatasetWriter(StreamingDatasetWriter core, java.lang.String[] filteredColumnNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> T[]
filterArray(T[] arry)
void
finish()
Notifies the writer to close- all data has been written.void
finishWithError(java.lang.Exception e)
Finishes the stream while indicating an error occurred.void
initialize(java.lang.String[] columnNames, java.lang.Class<?>[] columnTypes, boolean supportsQuality, int expectedRows)
Initializes the streaming dataset with important information, primarily the column names and types.protected void
initializeIndexesForNames(java.lang.String[] names)
void
write(java.lang.Object[] data, QualityCode[] quality)
Writes a row with the given data.
-
-
-
Constructor Detail
-
FilteredStreamingDatasetWriter
public FilteredStreamingDatasetWriter(StreamingDatasetWriter core, java.lang.Integer[] filteredColumnIndexes)
-
FilteredStreamingDatasetWriter
public FilteredStreamingDatasetWriter(StreamingDatasetWriter core, java.lang.String[] filteredColumnNames)
-
-
Method Detail
-
initializeIndexesForNames
protected void initializeIndexesForNames(java.lang.String[] names)
-
filterArray
protected <T> T[] filterArray(T[] arry)
-
initialize
public void initialize(java.lang.String[] columnNames, java.lang.Class<?>[] columnTypes, boolean supportsQuality, int expectedRows)
Description copied from interface:StreamingDatasetWriter
Initializes the streaming dataset with important information, primarily the column names and types. If supportsQuality is true, it is expected that every value added has an associated quality. expectedRows gives an idea as to how many rows will be returned- useful for progress indication. Should be -1 if the number cannot be known in advance.- Specified by:
initialize
in interfaceStreamingDatasetWriter
expectedRows
- -1 if not known, otherwise the number of rows that will be in the dataset.
-
write
public void write(java.lang.Object[] data, QualityCode[] quality) throws java.io.IOException
Description copied from interface:StreamingDatasetWriter
Writes a row with the given data. Bounds and order of arrays must match that used to call initialize. quality may be null if dataset does not support quality.- Specified by:
write
in interfaceStreamingDatasetWriter
- Throws:
java.io.IOException
-
finish
public void finish()
Description copied from interface:StreamingDatasetWriter
Notifies the writer to close- all data has been written. Should be called from a finally block.- Specified by:
finish
in interfaceStreamingDatasetWriter
-
finishWithError
public void finishWithError(java.lang.Exception e)
Description copied from interface:StreamingDatasetWriter
Finishes the stream while indicating an error occurred. Either this, or the successful finish(), must be called.- Specified by:
finishWithError
in interfaceStreamingDatasetWriter
-
-