|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.trinetwatch.params.ParamHistoryTable
public class ParamHistoryTable
Class ParamHistoryTable defines the history table for station parameters.
Field Summary | |
---|---|
static java.lang.String |
ARCHIVE_FNAME_PRESTR
Archive file-name prefix. |
static java.lang.String |
ARCHIVE_FNAME_SUFSTR
Archive file-name suffix. |
static java.lang.String |
KEY_VALUE_SEPARATOR
Key value separator. |
Constructor Summary | |
---|---|
ParamHistoryTable(ParamValues paramValues)
Constructs a history table. |
|
ParamHistoryTable(ParamValues paramValues,
ArchiveParameterFlag archiveParameterFlag)
Constructs a history table. |
Method Summary | |
---|---|
void |
add(DynamicParamHolder paramHolder,
Station stationObj,
DynamicParameter dParameter,
long timeLastChanged,
long timeLastReceived,
long minTime)
Adds the item to the history. |
protected static java.lang.String |
addKey(java.lang.String key,
java.lang.String str)
Adds the specified string to the key. |
void |
closeHistory()
Closes this history table, releasing resources allocated for its archive manager. |
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(long startTime,
long endTime)
Returns a new Vector containing 'ValueTimeBlock' objects with timestamps in the specified range. |
protected static java.lang.String |
getKey(Station stationObj,
DynamicParamHolder paramHolder,
DynamicParameter dParameter)
Gets the key for the specified station and dynamic parameter. |
ValueTimeBlock |
getNewestHistoryItem()
Returns the newest item in the history. |
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()
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). |
ArchivableData |
setupArchiveManager(DynamicParamHolder paramHolder,
Station stationObj,
DynamicParameter dParameter,
long timeLastReceived)
Sets up the archive manager for this table. |
static void |
terminateArchiveWorkerThreads()
Terminates the archive-worker threads for all parameter-history tables. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String KEY_VALUE_SEPARATOR
public static final java.lang.String ARCHIVE_FNAME_PRESTR
public static final java.lang.String ARCHIVE_FNAME_SUFSTR
Constructor Detail |
---|
public ParamHistoryTable(ParamValues paramValues, ArchiveParameterFlag archiveParameterFlag)
paramValues
- the parameter values.archiveParameterFlag
- the archive-parameter flag.public ParamHistoryTable(ParamValues paramValues)
paramValues
- the parameter values.Method Detail |
---|
protected java.lang.String getRootDirName(java.lang.String key)
key
- the key.
protected java.lang.String getFileName(java.lang.String key)
key
- the key.
protected static java.lang.String addKey(java.lang.String key, java.lang.String str)
key
- the current value of the key.str
- the string to add.
protected static java.lang.String getKey(Station stationObj, DynamicParamHolder paramHolder, DynamicParameter dParameter)
stationObj
- the station object.paramHolder
- the parameter holder.dParameter
- the dynamic parameter.
public void add(DynamicParamHolder paramHolder, Station stationObj, DynamicParameter dParameter, long timeLastChanged, long timeLastReceived, long minTime)
add
in interface ParamHistory
paramHolder
- the parameter holder.stationObj
- the station object.dParameter
- the dynamic parameter.timeLastChanged
- the time last changed (seconds since 1/1/1970).timeLastReceived
- the time last received (seconds since 1/1/1970).minTime
- the minimum time (seconds since 1/1/1970).public ArchivableData setupArchiveManager(DynamicParamHolder paramHolder, Station stationObj, DynamicParameter dParameter, long timeLastReceived)
setupArchiveManager
in interface ParamHistory
paramHolder
- the parameter holder.stationObj
- the station object.dParameter
- the dynamic parameter.timeLastReceived
- the time last received (seconds since 1/1/1970).
public java.util.Vector getHistoryVector(long startTime, long endTime)
getHistoryVector
in interface ParamHistory
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()
getNewestHistoryItem
in interface ParamHistory
public boolean isHistoryEnabled()
isHistoryEnabled
in interface ParamHistory
public void closeHistory()
closeHistory
in interface ParamHistory
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |