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)
ParamHistory
add
in interface ParamHistory
paramHolder
- the parameter holder.data
- the data.timeLastReceived
- the time last received (seconds since 1/1/1970).public void setupArchiveManager(DynamicParamHolder paramHolder, long timeLastReceived)
ParamHistory
setupArchiveManager
in interface ParamHistory
paramHolder
- the parameter holder.timeLastReceived
- the time last received (seconds since 1/1/1970).public java.util.Vector getHistoryVector(DynamicParamHolder paramHolder, long startTime, long endTime)
ParamHistory
getHistoryVector
in interface ParamHistory
paramHolder
- 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)
ParamHistory
getNewestHistoryItem
in interface ParamHistory
paramHolder
- the parameter holder.public ValueTimeBlock getNewestHistoryItem(DynamicParamHolder paramHolder, long startTime, long endTime)
ParamHistory
getNewestHistoryItem
in interface ParamHistory
paramHolder
- 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)
ParamHistory
isHistoryEnabled
in interface ParamHistory
paramHolder
- the parameter holder.public void closeHistory(DynamicParamHolder paramHolder)
ParamHistory
closeHistory
in interface ParamHistory
paramHolder
- 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.