public class TriggeredHistorical extends CachedDatabaseConnection
TAG1, TAG2, TAG3, READINGTIME
. A name can be assigned to the Connector
which will override the name on the component. Since the Connector names
need not be unique, this allows access to different tables, or multiple
access to the same tables, where the column names are the same. That is,
if two tables have a column "MYVALUE" then a component naming conflict can
be avoided by naming the connectors.
The types of the column are checked and automatic conversion will take place
if needed.
The primary output of this bean is true/false indicating the status of the last
save attempt.
The "CacheSize" output indicates the number of elements currently in the
cache, which will be non-zero if caching is enabled and active.
The "MessageStrings" output indicates the last recorded error as reported from
the database or an empty string if no error was reported.
If the write to the database fails, and the data is not successfully cached
then the "trigger" method will throw a VIBUpdateFailedException. If the
data is successfully cached, even if the write was unsuccessful, then the
method will not throw. The "MessageStrings" output will indicate the
error and the "CacheSize" will show the number of elements currently in
the cache.
Historical Package Only
SimpleDataSource.NameEditorData
DataSource.Writable
Modifier and Type | Field and Description |
---|---|
int |
saveQualityBetterThanOrEqualTo
The quality of a value must be better than this in order for a value
to be saved.
|
cvsRev, DELETE_OLDEST, IGNORE_NEW, THROW
alwaysCloseConnection, debugLevel, HSQLDB, logDateFormat, MYSQL, ORACLE, OTHER, POSTGRES, SQLITE
UPDATE_DISPLAYED_VALUE, VALUE_INPUT
customTimer, EXPORT_READ_ONLY, EXPORT_READ_WRITE, NO_EXPORT, requiresSyncWrite, sharedTimer, syncWriteTimeout, timebase
autoSuspend, AUTOSUSPEND_DEFAULT, AUTOSUSPEND_NEVER, AUTOSUSPEND_NO_LISTENERS, AUTOSUSPEND_NO_LISTENERS_AND_NO_SOURCES, colorHi, colorHiHi, colorLo, colorLoLo, colorNormal, connectors, consoleLogger, currentColor, currentValue, DEFAULT_AUTOSUSPEND, dontConnect, gwtLog, hardSuspended, popupLogger, PRIMARYOUTPORTNAME, sendColors, stopped, suspended, timedPopupLogger, traceLogger, valueHi, valueHiHi, valueLo, valueLoLo
Constructor and Description |
---|
TriggeredHistorical()
Create the manipulator.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Stop the data source and unregister us from the event listener.
|
java.util.List<java.lang.String> |
getColumns() |
java.util.List<java.lang.Integer> |
getColumnTypes() |
java.lang.String |
getDateColumnName()
Returns the applicationName of the table.
|
int |
getSaveQualityBetterThan()
The quality of a value must be better than this in order to be saved.
|
int |
getStaticLocationFor(java.lang.String loc)
This is used by the StaticMethodEvent to determine which valueChanged method to call.
|
void |
jsonTrigger(ValueChangedEvent newEvent)
This method triggers a write to the database.
|
void |
mapTrigger(ValueChangedEvent newEvent)
This method triggers a write to the database.
|
void |
pushCache(ValueChangedEvent newEvent)
This method will attempt to flush the database cache to the database, but without writing
a new value.
|
void |
setColumns(java.util.List<java.lang.String> columns) |
void |
setColumnTypes(java.util.List<java.lang.Integer> columnTypes) |
void |
setConnectionName(java.lang.String connectionName) |
void |
setDateColumnName(java.lang.String dateColumnName)
Sets the applicationName of the table.
|
void |
setSaveQualityBetterThan(int saveQualityBetterThanOrEqualTo)
The quality of a value must be better than this in order to be saved.
|
void |
start()
Enable data saving and attempt a save if a trigger has been seen.
|
void |
trigger(ValueChangedEvent newEvent)
This method triggers a write to the database.
|
boolean |
update(long triggerTime,
java.util.Map<java.lang.String,ValueObjectInterface> values,
int expectedCount)
This is called whenever the manipulator is triggered.
|
boolean |
updateWithMap(long timestamp,
java.util.Map<java.lang.String,ValueObjectInterface> values,
boolean writeNew)
Save the contents of the map to the database.
|
void |
valueChanged(int loc,
ValueChangedEvent e)
This allows the for a staticmethodevent to occur.
|
void |
valueInput(ValueChangedEvent newEvent)
This method accepts the new values that are to be stored to the database.
|
void |
VIBEvent(VIBEvent theEvent)
We are interested in few events.
|
getCachedValueAt, getCacheFullBehavior, getCacheSize, setCacheFullBehavior, setCacheSize
connectionClosed, eventInfo, getConnectionName, getConsoleReport, getDataBaseType, getTableName, isCreateIndex, isCreateTable, isMillisPrecision, isSynchronizeConnection, logInfo, messageString, setConsoleReport, setCreateIndex, setCreateTable, setMillisPrecision, setSimulationFlag, setSynchronizeConnection, setTableName, simulationStateChanged, stop, tableExists, toString
getDefaultQualityForLocation
getInPortNames, setBooleanValue, setBoolValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue
addConnector, addConnector, addDataSource, addPropertyChangeListener, addValueChangedListener, addVetoableChangeListener, authenticatedClientRequest, clientRequest, clientResponse, determineSuspendedStatus, getClassLicenseManager, getContainer, getCustomTimer, getDataSource, getDataSources, getDisplayName, getExportCriteria, getExposeComponentConnections, getName, getOutPortNames, getPullFromServers, getPushData, getPushName, getPushToServers, getServerListData, getTimebase, getTrace, isActive, isScreenLocal, refreshCurrentValue, removeConnector, removeDataSource, removePropertyChangeListener, removeValueChangedListener, removeVetoableChangeListener, requestSyncWrite, setAutoSuspend, setClassLicenseManager, setContainer, setCustomTimer, setDataSourceName, setExportCriteria, setExposeComponentConnections, setName, setPullFromServers, setPushData, setPushName, setPushToServers, setScreenLocal, setServerListData, setTimebase, setTrace, setValueObject, tick
addVIBEventListener, checkScript, executeInScriptInternal, executeScript, executeScriptInternal, executeScriptInternal, getAutoSuspend, getBooleanValue, getBoolValue, getColorHi, getColorHiHi, getColorLo, getColorLoLo, getColorNormal, getConnectors, getConsoleLogger, getCurrentColor, getDataSourceName, getDoubleValue, getFloatValue, getGWTLogger, getIncomingValueObject, getInScript, getIntValue, getLongValue, getParent, getPopupLogger, getScript, getScriptEngine, getSendColors, getSources, getStringValue, getSyncWriteTimeout, getTimedPopupLogger, getTraceLogger, getValueHi, getValueHiHi, getValueLo, getValueLoLo, getValueObject, init, isHardSuspended, isRunning, isSendOnlyChangedValuesDefault, isSuspended, logException, logGWT, logGWT, logMessage, logTrace, n2sortConnectors, performScriptSubstitutions, popupMessage, post, removeConnector, removeVIBEventListener, replaceConnectors, scriptExtensionSubstition, setColorHi, setColorHiHi, setColorLo, setColorLoLo, setColorNormal, setConsoleLogger, setGWTLogger, setHardSuspended, setInScript, setParent, setPopupLogger, setScript, setSendColors, setSendOnlyChangedValuesDefault, setSyncWriteTimeout, setTimedPopupLogger, setTraceLogger, setValueHi, setValueHiHi, setValueLo, setValueLoLo, updateColor, updateListeners, updateListeners, updateListeners, whoAmI
public int saveQualityBetterThanOrEqualTo
public void destroy() throws BadParameterException
destroy
in class SimpleDataSource
BadParameterException
SimpleDataSource.stop()
public java.util.List<java.lang.String> getColumns()
public java.util.List<java.lang.Integer> getColumnTypes()
public java.lang.String getDateColumnName()
getDateColumnName
in class DatabaseConnection
public int getSaveQualityBetterThan()
public int getStaticLocationFor(java.lang.String loc) throws BadParameterException
getStaticLocationFor
in class Manipulator
BadParameterException
public void jsonTrigger(ValueChangedEvent newEvent) throws VIBUpdateFailedException
newEvent
- the event causing the write. The time of the event is used
as the value of the timestamp for the write, the value is otherwise
ignored.VIBUpdateFailedException
- If the write to the database fails
and the data is not successfully cached.public void mapTrigger(ValueChangedEvent newEvent) throws VIBUpdateFailedException
newEvent
- the event causing the write. The time of the event is used
as the value of the timestamp for the write, the value is otherwise
ignored.VIBUpdateFailedException
- If the write to the database fails
and the data is not successfully cached.public void pushCache(ValueChangedEvent newEvent) throws VIBUpdateFailedException
newEvent
- the event causing the write. The time of the event is used
as the value of the timestamp for the write, the value is otherwise
ignored.VIBUpdateFailedException
- If the write to the database fails
and the data is not successfully cached.public void setColumns(java.util.List<java.lang.String> columns)
public void setColumnTypes(java.util.List<java.lang.Integer> columnTypes)
public void setConnectionName(java.lang.String connectionName)
setConnectionName
in class DatabaseConnection
connectionName
- The connectionName to set.public void setDateColumnName(java.lang.String dateColumnName)
setDateColumnName
in class DatabaseConnection
dateColumnName
- The dateColumnName to set.public void setSaveQualityBetterThan(int saveQualityBetterThanOrEqualTo)
saveQualityBetterThanOrEqualTo
- The saveQualityBetterThanOrEqualTo to set.public void start() throws BadParameterException, VIBUpdateFailedException
start
in class DatabaseConnection
BadParameterException
VIBUpdateFailedException
public void trigger(ValueChangedEvent newEvent) throws VIBUpdateFailedException
newEvent
- the event causing the write. The time of the event is used
as the value of the timestamp for the write, the value is otherwise
ignored.VIBUpdateFailedException
- If the write to the database fails
and the data is not successfully cached.public boolean update(long triggerTime, java.util.Map<java.lang.String,ValueObjectInterface> values, int expectedCount)
triggerTime
- the time to assoicate with the valuesvalues
- the values to storeexpectedCount
- the expected number of values that will be stored.public boolean updateWithMap(long timestamp, java.util.Map<java.lang.String,ValueObjectInterface> values, boolean writeNew)
timestamp
- the timestamp associated with the valuesvalues
- the values to savewriteNew
- whether new values should be stored to the database (or just the cached values)public void valueChanged(int loc, ValueChangedEvent e) throws VIBUpdateFailedException, BadParameterException
valueChanged
in class Manipulator
VIBUpdateFailedException
BadParameterException
public void valueInput(ValueChangedEvent newEvent) throws VIBUpdateFailedException
valueInput
in class Manipulator
newEvent
- The ValueChangedEvent that the bean or data source has sent.VIBUpdateFailedException
public void VIBEvent(VIBEvent theEvent) throws BadParameterException
VIBEvent
in class SimpleDataSource
BadParameterException
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.