public class ParamHistoryTable extends java.lang.Object implements ParamHistory
ARCHIVE_NAME_PREFIX, ARCHIVE_NAME_SUFFIX, KEY_VALUE_SEPARATOR| Constructor and Description |
|---|
ParamHistoryTable(DynamicParamHolder paramHolder)
Constructs a history table.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(DynamicParamHolder paramHolder,
java.lang.Object data,
long timeLastReceived)
Adds the item to the history.
|
void |
closeHistory(DynamicParamHolder paramHolder)
Closes this history, releasing resources allocated for it.
|
protected java.lang.String |
getFileName(java.lang.String key)
Gets the file name for the specified key.
|
protected static java.io.File |
getFileObjForStation(ParamValues paramValuesObj,
Station stationObj)
Returns a 'File' object set to the given station's directory location in
the history archive.
|
java.util.Vector |
getHistoryVector(DynamicParamHolder paramHolder,
long startTime,
long endTime)
Returns a new Vector containing 'ValueTimeBlock' objects with timestamps in
the specified range.
|
ValueTimeBlock |
getNewestHistoryItem(DynamicParamHolder paramHolder)
Returns the newest item in the history.
|
ValueTimeBlock |
getNewestHistoryItem(DynamicParamHolder paramHolder,
long startTime,
long endTime)
Returns the newest item in the history with a timestamp in the specified
range.
|
static java.util.List |
getParamsListForStation(ParamValues paramValuesObj,
Station stationObj,
GroupTable agentsTable)
Returns a list of dynamic parameters found in the given station's history
archive.
|
protected java.lang.String |
getRootDirName(java.lang.String key)
Gets the root directory name for the specified key.
|
boolean |
isHistoryEnabled(DynamicParamHolder paramHolder)
Determines if the history is enabled.
|
static boolean |
isStationHistoryAvail(ParamValues paramValuesObj,
Station stationObj)
Determines if history for the given station is available (based on whether
or not a directory exists in the given station's location in the history
archive).
|
void |
setupArchiveManager(DynamicParamHolder paramHolder,
long timeLastReceived)
Sets up the archive manager for this history.
|
static void |
terminateArchiveWorkerThreads()
Terminates the archive-worker threads for all parameter-history tables.
|
public ParamHistoryTable(DynamicParamHolder paramHolder)
paramHolder - the parameter values.protected java.lang.String getRootDirName(java.lang.String key)
key - the key.protected java.lang.String getFileName(java.lang.String key)
key - the key.public void add(DynamicParamHolder paramHolder, java.lang.Object data, long timeLastReceived)
ParamHistoryadd in interface ParamHistoryparamHolder - the parameter holder.data - the data.timeLastReceived - the time last received (seconds since 1/1/1970).public void setupArchiveManager(DynamicParamHolder paramHolder, long timeLastReceived)
ParamHistorysetupArchiveManager in interface ParamHistoryparamHolder - the parameter holder.timeLastReceived - the time last received (seconds since 1/1/1970).public java.util.Vector getHistoryVector(DynamicParamHolder paramHolder, long startTime, long endTime)
ParamHistorygetHistoryVector in interface ParamHistoryparamHolder - the parameter holder.startTime - the start time for the range, or 0 for the beginning of
the history.endTime - the end time for the range, or 0 for the end of the history.public ValueTimeBlock getNewestHistoryItem(DynamicParamHolder paramHolder)
ParamHistorygetNewestHistoryItem in interface ParamHistoryparamHolder - the parameter holder.public ValueTimeBlock getNewestHistoryItem(DynamicParamHolder paramHolder, long startTime, long endTime)
ParamHistorygetNewestHistoryItem in interface ParamHistoryparamHolder - the parameter holder.startTime - the start time for the range, or 0 for the beginning of
the history.endTime - the end time for the range, or 0 for the end of the history.public boolean isHistoryEnabled(DynamicParamHolder paramHolder)
ParamHistoryisHistoryEnabled in interface ParamHistoryparamHolder - the parameter holder.public void closeHistory(DynamicParamHolder paramHolder)
ParamHistorycloseHistory in interface ParamHistoryparamHolder - the parameter holder.public static void terminateArchiveWorkerThreads()
protected static java.io.File getFileObjForStation(ParamValues paramValuesObj, Station stationObj)
paramValuesObj - object that implements the parameter-values
interface.stationObj - station object for target station.public static java.util.List getParamsListForStation(ParamValues paramValuesObj, Station stationObj, GroupTable agentsTable)
paramValuesObj - object that implements the parameter-values
interface.stationObj - station object for target station.agentsTable - table of agent objects to use.public static boolean isStationHistoryAvail(ParamValues paramValuesObj, Station stationObj)
paramValuesObj - object that implements the parameter-values
interface.stationObj - station object for target station.