Class BasicHistoricalRecord
java.lang.Object
com.inductiveautomation.ignition.gateway.history.BasicHistoricalRecord
- All Implemented Interfaces:
CacheOptimizedData
,CacheOptimizedSchema
,DatasourceData
,GroupableData
,HistoricalData
,Serializable
public class BasicHistoricalRecord
extends Object
implements DatasourceData, CacheOptimizedData, CacheOptimizedSchema, GroupableData
The basic historical record represents a specific query with columns of data. It supports many advanced features of
the store and forward system- data grouping, "cache optimized" storage, etc.
This record acts both as the courier and schema of the data- it implements CacheOptimizedSchema, which means it can be serialized and will only have the column information. It can then reconstitute the original record when provided with the raw data, that was serialized separately.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
protected static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addColumn
(HistoricalColumn column) Adds a pre-defined column to the row.void
Creates a value column with the given name.void
addColumn
(String name, QualifiedValue value) Adds a column with data to the row.void
createData
(Object valueData) int
This returns the number of rows of this historical record.The very broad "flavor" designator, used to get the data to the correct sink.Grouping optimization codeReturns the name of the logger that should be notified when something happens to this data.protected String
getQuery
(DBTranslator translator) The basic record just returns itself as the schema.The signature is a static string that describes this data as uniquely as possible.groupData
(GroupableData other) Merge another piece of similar data into this one.boolean
void
setLoggerName
(String loggerName) void
setTablename
(String value) void
Called after passing through the store and forward system, the data should store itself to the open connection.protected boolean
Execution code
-
Field Details
-
FLAVOR
-
-
Constructor Details
-
BasicHistoricalRecord
public BasicHistoricalRecord() -
BasicHistoricalRecord
-
-
Method Details
-
getFlavor
Description copied from interface:HistoricalData
The very broad "flavor" designator, used to get the data to the correct sink. That is, different sinks support different types of data, and this is used to match them up.- Specified by:
getFlavor
in interfaceHistoricalData
-
getColumns
-
addColumn
Adds a pre-defined column to the row. This allows the caller to provide a custom column type, or use something besides the standard ValueHistoricalColumn. -
addColumn
Creates a value column with the given name. Values must be added later with addRow. -
addColumn
Adds a column with data to the row. Quickest way to build a single row HistoricalRecord. -
quoteColumnNames
public boolean quoteColumnNames() -
addRow
-
getDataCount
public int getDataCount()This returns the number of rows of this historical record.- Specified by:
getDataCount
in interfaceHistoricalData
-
getLoggerName
Description copied from interface:HistoricalData
Returns the name of the logger that should be notified when something happens to this data. If null or empty, notifications won't occur (errors, however, may still be logged to the general logger).- Specified by:
getLoggerName
in interfaceHistoricalData
-
setLoggerName
-
getTablename
-
setTablename
-
getSchema
The basic record just returns itself as the schema. The actual values in the history columns are transient, so they don't get serialized.- Specified by:
getSchema
in interfaceCacheOptimizedData
-
getSignature
Description copied from interface:HistoricalData
The signature is a static string that describes this data as uniquely as possible. This will be used to group data in the data cache (for example, when displaying quarantined data), as well as uniquely identifying cacheable schemas, etc.Basically, the golden rule is that if two pieces of data have the same signature, the came from the same place, and are going to the same place, and in theory could be grouped together (note: they won't be, that is done with the
GroupableData
interface).- Specified by:
getSignature
in interfaceHistoricalData
-
getValueData
- Specified by:
getValueData
in interfaceCacheOptimizedData
-
createData
- Specified by:
createData
in interfaceCacheOptimizedSchema
- Throws:
Exception
-
getGroupId
Grouping optimization code- Specified by:
getGroupId
in interfaceGroupableData
-
groupData
Description copied from interface:GroupableData
Merge another piece of similar data into this one.- Specified by:
groupData
in interfaceGroupableData
-
useBatching
protected boolean useBatching()Execution code -
storeToConnection
Description copied from interface:DatasourceData
Called after passing through the store and forward system, the data should store itself to the open connection. If it cannot, it should throw an exception. After several retries, the data will be quarantined.- Specified by:
storeToConnection
in interfaceDatasourceData
- Throws:
Exception
-
getQuery
-