Class BasicStreamingDataset
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.AbstractDataset
- 
- com.inductiveautomation.ignition.gateway.datasource.BasicStreamingDataset
 
 
- 
- All Implemented Interfaces:
- Dataset,- StreamingDatasetWriter,- java.io.Serializable
 
 public class BasicStreamingDataset extends AbstractDataset implements StreamingDatasetWriter Basic implementation of StreamingDatasetWriter that simply writes each row into an in-memory datastructure ( a List )- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class com.inductiveautomation.ignition.common.AbstractDataset_columnNamesLowercase, columnNames, columnTypes, qualityCodes
 
- 
 - 
Constructor SummaryConstructors Constructor Description BasicStreamingDataset()BasicStreamingDataset(java.sql.ResultSet rs)Creates a dataset by streaming the results of a JDBC ResultSetBasicStreamingDataset(java.sql.ResultSet rs, boolean useLargestTypes)Creates a dataset by streaming the results of a JDBC ResultSet.BasicStreamingDataset(java.util.List<java.lang.String> columnNames, java.util.List<java.lang.Class<?>> columnTypes)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinish()Notifies the writer to close- all data has been written.voidfinishWithError(java.lang.Exception e)Finishes the stream while indicating an error occurred.QualityCode[][]getBulkQualityCodes()java.lang.ExceptiongetError()QualityCodegetQualityAt(int row, int col)Returns the quality of the value at the given location.intgetRowCount()Return the number of rows in this datasetjava.lang.ObjectgetValueAt(int row, int col)Returns the value in the dataset at the given location.booleanhasQualityData()Whether this dataset has any quality data to report.voidinitialize(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.voidprintToConsole()voidwrite(java.lang.Object[] data, QualityCode[] quality)Writes a row with the given data.- 
Methods inherited from class com.inductiveautomation.ignition.common.AbstractDatasetconvertToQualityCodes, getAsXML, getColumnCount, getColumnIndex, getColumnName, getColumnNames, getColumnType, getColumnTypes, getPrimitiveValueAt, getValueAt, setColumnNames, setColumnTypes, setDirty
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.inductiveautomation.ignition.common.DatasetbinarySearch, getColumnAsList
 
- 
 
- 
- 
- 
Constructor Detail- 
BasicStreamingDatasetpublic BasicStreamingDataset() 
 - 
BasicStreamingDatasetpublic BasicStreamingDataset(java.util.List<java.lang.String> columnNames, java.util.List<java.lang.Class<?>> columnTypes)
 - 
BasicStreamingDatasetpublic BasicStreamingDataset(java.sql.ResultSet rs) throws java.sql.SQLExceptionCreates a dataset by streaming the results of a JDBC ResultSet- Throws:
- java.sql.SQLException
 
 - 
BasicStreamingDatasetpublic BasicStreamingDataset(java.sql.ResultSet rs, boolean useLargestTypes) throws java.sql.SQLExceptionCreates 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:
- java.sql.SQLException
 
 
- 
 - 
Method Detail- 
getErrorpublic java.lang.Exception getError() 
 - 
initializepublic void initialize(java.lang.String[] columnNames, java.lang.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 interface- StreamingDatasetWriter
- expectedRows- -1 if not known, otherwise the number of rows that will be in the dataset.
 
 - 
writepublic void write(java.lang.Object[] data, QualityCode[] quality)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 interface- StreamingDatasetWriter
 
 - 
finishpublic 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 interface- StreamingDatasetWriter
 
 - 
finishWithErrorpublic void finishWithError(java.lang.Exception e) Description copied from interface:StreamingDatasetWriterFinishes the stream while indicating an error occurred. Either this, or the successful finish(), must be called.- Specified by:
- finishWithErrorin interface- StreamingDatasetWriter
 
 - 
getQualityAtpublic QualityCode getQualityAt(int row, int col) Description copied from interface:DatasetReturns the quality of the value at the given location.- Specified by:
- getQualityAtin interface- Dataset
- Overrides:
- getQualityAtin class- AbstractDataset
 
 - 
hasQualityDatapublic 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 interface- Dataset
- Overrides:
- hasQualityDatain class- AbstractDataset
- See Also:
- Dataset.getQualityAt(int, int)
 
 - 
getRowCountpublic int getRowCount() Description copied from interface:DatasetReturn the number of rows in this dataset- Specified by:
- getRowCountin interface- Dataset
 
 - 
getValueAtpublic java.lang.Object getValueAt(int row, int col)Description copied from interface:DatasetReturns the value in the dataset at the given location.- Specified by:
- getValueAtin interface- Dataset
 
 - 
printToConsolepublic void printToConsole() 
 - 
getBulkQualityCodespublic QualityCode[][] getBulkQualityCodes() - Overrides:
- getBulkQualityCodesin class- AbstractDataset
 
 
- 
 
-