Class BasicStreamingDataset
java.lang.Object
com.inductiveautomation.ignition.common.AbstractDataset
com.inductiveautomation.ignition.gateway.datasource.BasicStreamingDataset
- All Implemented Interfaces:
Dataset,StreamingDatasetWriter,Serializable
Basic implementation of StreamingDatasetWriter that simply writes each row into an in-memory datastructure ( a List )
- See Also:
-
Field Summary
Fields inherited from class com.inductiveautomation.ignition.common.AbstractDataset
_columnNamesLowercase, columnNames, columnTypes, qualityCodes -
Constructor Summary
ConstructorsConstructorDescriptionCreates a dataset by streaming the results of a JDBC ResultSetBasicStreamingDataset(ResultSet rs, boolean useLargestTypes) Creates a dataset by streaming the results of a JDBC ResultSet.BasicStreamingDataset(List<String> columnNames, List<Class<?>> columnTypes) -
Method Summary
Modifier and TypeMethodDescriptionvoidfinish()Notifies the writer to close- all data has been written.voidFinishes the stream while indicating an error occurred.QualityCode[][]getError()getQualityAt(int row, int col) Returns the quality of the value at the given location.intReturn the number of rows in this datasetgetValueAt(int row, int col) Returns the value in the dataset at the given location.booleanWhether this dataset has any quality data to report.voidinitialize(String[] columnNames, Class<?>[] columnTypes, boolean supportsQuality, int expectedRows) Initializes the streaming dataset with important information, primarily the column names and types.voidvoidwrite(Object[] data, QualityCode[] quality) Writes a row with the given data.Methods inherited from class com.inductiveautomation.ignition.common.AbstractDataset
convertToQualityCodes, getAsXML, getColumnCount, getColumnIndex, getColumnName, getColumnNames, getColumnType, getColumnTypes, getPrimitiveValueAt, getValueAt, setColumnNames, setColumnTypes, setDirty, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.inductiveautomation.ignition.common.Dataset
binarySearch, getColumnAsList
-
Constructor Details
-
BasicStreamingDataset
public BasicStreamingDataset() -
BasicStreamingDataset
-
BasicStreamingDataset
Creates a dataset by streaming the results of a JDBC ResultSet- Throws:
SQLException
-
BasicStreamingDataset
Creates a dataset by streaming the results of a JDBC ResultSet.- Parameters:
useLargestTypes- Forces the use of 64-bit primitives (Long, Double) instead of Integer/Float, in cases where the database does not provide a distinction between these types internally (e.g., SQLite)- Throws:
SQLException
-
-
Method Details
-
getError
-
initialize
public void initialize(String[] columnNames, Class<?>[] columnTypes, boolean supportsQuality, int expectedRows) Description copied from interface:StreamingDatasetWriterInitializes 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:
initializein interfaceStreamingDatasetWriterexpectedRows- -1 if not known, otherwise the number of rows that will be in the dataset.
-
write
Description copied from interface:StreamingDatasetWriterWrites 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:
writein interfaceStreamingDatasetWriter
-
finish
public void finish()Description copied from interface:StreamingDatasetWriterNotifies the writer to close- all data has been written. Should be called from a finally block.- Specified by:
finishin interfaceStreamingDatasetWriter
-
finishWithError
Description copied from interface:StreamingDatasetWriterFinishes the stream while indicating an error occurred. Either this, or the successful finish(), must be called.- Specified by:
finishWithErrorin interfaceStreamingDatasetWriter
-
getQualityAt
Description copied from interface:DatasetReturns the quality of the value at the given location.- Specified by:
getQualityAtin interfaceDataset- Overrides:
getQualityAtin classAbstractDataset
-
hasQualityData
public boolean hasQualityData()Description copied from interface:DatasetWhether this dataset has any quality data to report. If false, getQualityAt is expected to returnQualityCode.Good.- Specified by:
hasQualityDatain interfaceDataset- Overrides:
hasQualityDatain classAbstractDataset- See Also:
-
getRowCount
public int getRowCount()Description copied from interface:DatasetReturn the number of rows in this dataset- Specified by:
getRowCountin interfaceDataset
-
getValueAt
Description copied from interface:DatasetReturns the value in the dataset at the given location.- Specified by:
getValueAtin interfaceDataset
-
printToConsole
public void printToConsole() -
getBulkQualityCodes
- Overrides:
getBulkQualityCodesin classAbstractDataset
-