Class StreamingDatasetJsonWriter
java.lang.Object
com.inductiveautomation.ignition.common.StreamingDatasetJsonWriter
- All Implemented Interfaces:
StreamingDatasetWriter
-
Constructor Summary
ConstructorsConstructorDescriptionStreamingDatasetJsonWriter(com.inductiveautomation.ignition.common.gson.stream.JsonWriter writer, Consumer<Exception> exceptionHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidfinish()Notifies the writer to close- all data has been written.voidFinishes the stream while indicating an error occurred.voidinitialize(String[] columnNames, Class<?>[] columnTypes, boolean supportsQuality, int expectedRows) Initializes the streaming dataset with important information, primarily the column names and types.voidwrite(Object[] data, QualityCode[] quality) Writes a row with the given data.
-
Constructor Details
-
StreamingDatasetJsonWriter
-
-
Method Details
-
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- Throws:
IOException
-
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
-