public class BasicHistoricalRecord extends java.lang.Object implements DatasourceData, CacheOptimizedData, CacheOptimizedSchema, GroupableData
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.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BasicHistoricalRecord.HistoricalRecordFlavor |
protected static class |
BasicHistoricalRecord.HistoricalRecordXmlReader |
| Modifier and Type | Field and Description |
|---|---|
static BasicHistoricalRecord.HistoricalRecordFlavor |
FLAVOR |
| Constructor and Description |
|---|
BasicHistoricalRecord() |
BasicHistoricalRecord(java.lang.String tableName,
java.lang.String loggerName) |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(HistoricalColumn column)
Adds a pre-defined column to the row.
|
void |
addColumn(java.lang.String name)
Creates a value column with the given name.
|
void |
addColumn(java.lang.String name,
TagValue value)
Adds a column with data to the row.
|
void |
addRow(java.util.List<java.lang.Object> rowData) |
HistoricalData |
createData(java.lang.Object valueData) |
java.util.List<HistoricalColumn> |
getColumns() |
int |
getDataCount()
This returns the number of rows of this historical record.
|
HistoryFlavor |
getFlavor()
The very broad "flavor" designator, used to get the data to the correct sink.
|
java.lang.String |
getGroupId()
Grouping optimization code
|
java.lang.String |
getLoggerName()
Returns the name of the logger that should be notified when something happens to this data.
|
protected java.lang.String |
getQuery(DBTranslator translator) |
CacheOptimizedSchema |
getSchema()
The basic record just returns itself as the schema.
|
java.lang.String |
getSignature()
The signature is a static string that describes this data as uniquely as possible.
|
java.lang.String |
getTablename() |
java.lang.Object |
getValueData() |
GroupableData |
groupData(GroupableData other)
Merge another piece of similar data into this one.
|
boolean |
quoteColumnNames() |
void |
setLoggerName(java.lang.String loggerName) |
void |
setTablename(java.lang.String value) |
void |
storeToConnection(SRConnection conn)
Called after passing through the store and forward system, the data should store itself to the open connection.
|
protected boolean |
useBatching()
Execution code
|
public static final BasicHistoricalRecord.HistoricalRecordFlavor FLAVOR
public BasicHistoricalRecord()
public BasicHistoricalRecord(java.lang.String tableName,
java.lang.String loggerName)
public HistoryFlavor getFlavor()
HistoricalDatagetFlavor in interface HistoricalDatapublic java.util.List<HistoricalColumn> getColumns()
public void addColumn(HistoricalColumn column)
public void addColumn(java.lang.String name)
public void addColumn(java.lang.String name,
TagValue value)
public boolean quoteColumnNames()
public void addRow(java.util.List<java.lang.Object> rowData)
public int getDataCount()
getDataCount in interface HistoricalDatapublic java.lang.String getLoggerName()
HistoricalDatagetLoggerName in interface HistoricalDatapublic void setLoggerName(java.lang.String loggerName)
public java.lang.String getTablename()
public void setTablename(java.lang.String value)
public CacheOptimizedSchema getSchema()
getSchema in interface CacheOptimizedDatapublic java.lang.String getSignature()
HistoricalData
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).
getSignature in interface HistoricalDatapublic java.lang.Object getValueData()
getValueData in interface CacheOptimizedDatapublic HistoricalData createData(java.lang.Object valueData) throws java.lang.Exception
createData in interface CacheOptimizedSchemajava.lang.Exceptionpublic java.lang.String getGroupId()
getGroupId in interface GroupableDatapublic GroupableData groupData(GroupableData other)
GroupableDatagroupData in interface GroupableDataprotected boolean useBatching()
public void storeToConnection(SRConnection conn) throws java.lang.Exception
DatasourceDatastoreToConnection in interface DatasourceDatajava.lang.Exceptionprotected java.lang.String getQuery(DBTranslator translator)