|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.trinetwatch.station.StationTable
public class StationTable
Class StationTable manages a table of Station objects (each object is associated with one station).
Nested Class Summary | |
---|---|
protected class |
StationTable.PurgeLevelsCacheThread
Class PurgeLevelsCacheThread defines a thread that manages the clearing of old entries from the station-levels cache. |
Field Summary | |
---|---|
static java.lang.String |
LAT_LON_PREFIX_TEXT
Extended lat/lon prefix text: |
Constructor Summary | |
---|---|
StationTable()
|
Method Summary | |
---|---|
boolean |
add(Station stationObj)
Adds the given station object to the table. |
boolean |
addAll(StationTable srcTableObj)
Adds the station objects from the given table to this table. |
boolean |
containsKey(java.lang.String name)
Tests if a station with the specified short name exists in the table. |
boolean |
containsValue(Station stationObj)
Tests if the given station object exists in the table. |
java.util.Enumeration |
elements()
Returns an enumeration of station hash table values. |
void |
enterTableData(StationTable srcTableObj)
Enters the data from the given table into this table. |
void |
enterTableData(StationTable srcTableObj,
boolean closeRemFlag)
Enters the data from the given table into this table. |
Station |
get(java.lang.String name)
Returns the Station object in the table with the given short name. |
static java.lang.Integer |
getDefaultSameStatusPercent()
Get the default same status percent. |
java.lang.String |
getDisplayString()
Returns a display string containing basic information about all the stations in the table (and their fields), with each station on a separate line. |
java.lang.String |
getDisplayString(boolean cfgParamsFlag)
Returns a display string containing information about all the stations in the table (and their fields), with each station on a separate line. |
java.util.Vector |
getKeysVector()
Returns a new Vector containing the keys in the station hashtable. |
StatusLevelTag |
getSameStatusLevel()
If all stations in the table have the same status level then it is returned; otherwise 'null' is returned. |
static CfgPropValidator |
getSameStatusPerecentValidator()
Get the same status percent validator. |
long |
getSameStatusTime()
Returns the time associated with the last change to the value returned by 'getSameStatusLevel()', or zero if no changes have occurred. |
java.lang.String |
getSnapshotStrFromCache(long dataTimeVal)
Returns an snapshot string of entries for all stations at the given historical time value, fetched from the levels cache for each station. |
java.lang.String |
getSnapshotString(long dataTimeVal,
long prefetchTimeVal,
StatusLevelTable sLevelTableObj,
UsageLevelTable uLevelTableObj)
Returns an snapshot string of entries for all stations at the given historical time value. |
Station |
getStationForDParam(DynamicParamHolder dParam)
Returns the station object that holds the given dynamic parameter object, or null if none could be found. |
java.lang.Object |
getThreadSyncObj()
Returns the thread-synchronization object for this table. |
java.lang.String |
getUpdateString(long timeVal)
Returns an update string of entries for all stations that have changed status or usage since the given time value. |
java.lang.String |
getUpdateString(java.lang.String agentName,
long timeVal)
Returns an update string of entries for all stations that have changed status or usage since the given time value. |
java.lang.String |
getUpdateString(java.lang.String agentName,
long timeVal,
boolean extendedFlag)
Returns an update string of entries for all stations that have changed status or usage since the given time value. |
java.util.Vector |
getValuesVector()
Returns a new Vector containing the values in the hashtable. |
java.util.Enumeration |
keys()
Returns an enumeration of station hash table keys. |
void |
loadDynParamsFromArchive(ParamValues paramValuesObj,
StatusLevelTable sLevelTableObj,
UsageLevelTable uLevelTableObj,
GroupTable agentsTable,
long minTimeVal)
Loads the status level, usage level and dynamic parameters from the newest items in the history archive. |
void |
preloadAndEnableLevelsCaches(ParamValues paramValuesObj,
long baseTimeVal,
StatusLevelTable sLevelTableObj,
UsageLevelTable uLevelTableObj)
Preloads the station-levels cache from the history archive and enables it for each station in table. |
void |
procSameStatusLevel()
Tracks the status levels of the stations. |
Station |
remove(java.lang.String name)
Removes the Station object in the table with the given short name. |
boolean |
removeAll(StationTable srcTableObj)
Removes the station objects in the given table from this table. |
static void |
setSameStatusPercent(int value)
Set the same status percent. |
void |
startLevelsCachesPurgeThread(long levelsCacheSecs)
Starts the station-levels cache purge thread. |
int |
stationCount()
Returns a count of the number of station name keys in the table. |
void |
stopLevelsCachesPurgeThread()
Starts the station-levels cache purge thread. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LAT_LON_PREFIX_TEXT
Constructor Detail |
---|
public StationTable()
Method Detail |
---|
public static java.lang.Integer getDefaultSameStatusPercent()
public static CfgPropValidator getSameStatusPerecentValidator()
public static void setSameStatusPercent(int value)
percent
- the same status percent.public boolean add(Station stationObj)
stationObj
- the station object.
public Station get(java.lang.String name)
name
- the short name of the station.
public Station remove(java.lang.String name)
name
- the short name of the station.
public java.lang.Object getThreadSyncObj()
public boolean addAll(StationTable srcTableObj)
srcTableObj
- source table to read from.
public boolean removeAll(StationTable srcTableObj)
srcTableObj
- source table.
public void enterTableData(StationTable srcTableObj, boolean closeRemFlag)
srcTableObj
- source table to read from.closeRemFlag
- true to invoke 'closeParamHistories()' on
station objects that are removed.public void enterTableData(StationTable srcTableObj)
srcTableObj
- source table to read from.public boolean containsKey(java.lang.String name)
name
- the short name of the station.
public boolean containsValue(Station stationObj)
stationObj
- the station object.
public java.util.Enumeration keys()
public java.util.Enumeration elements()
public int stationCount()
public java.util.Vector getKeysVector()
public java.util.Vector getValuesVector()
public java.lang.String getUpdateString(java.lang.String agentName, long timeVal)
agentName
- the name of the agent to use in determining status,
or null for no agent.timeVal
- a server epoch time value (seconds since 1/1/1970).
public java.lang.String getUpdateString(java.lang.String agentName, long timeVal, boolean extendedFlag)
agentName
- the name of the agent to use in determining status,
or null for no agent.timeVal
- a server epoch time value (seconds since 1/1/1970).extendedFlag
- true for extended information, false otherwise.
public java.lang.String getUpdateString(long timeVal)
timeVal
- a server epoch time value (seconds since 1/1/1970).
public java.lang.String getSnapshotString(long dataTimeVal, long prefetchTimeVal, StatusLevelTable sLevelTableObj, UsageLevelTable uLevelTableObj)
dataTimeVal
- desired time value for data, in seconds since
1/1/1970.prefetchTimeVal
- time value for which archive data should
be prefetched in search of the last entry before the 'dataTimeVal'
time value (seconds since 1/1/1970).sLevelTableObj
- status-level table to use for translating
status-level names to objects.uLevelTableObj
- usage-level table to use for translating
usage-level names to objects.
public void loadDynParamsFromArchive(ParamValues paramValuesObj, StatusLevelTable sLevelTableObj, UsageLevelTable uLevelTableObj, GroupTable agentsTable, long minTimeVal)
paramValuesObj
- object that implements the parameter-values
interface.sLevelTableObj
- status-level table to use.uLevelTableObj
- usage-level table to use.agentsTable
- table of agent objects to use.minTimeVal
- minimum-acceptable time value for loaded
parameters (in seconds since 1/1/1970).public void preloadAndEnableLevelsCaches(ParamValues paramValuesObj, long baseTimeVal, StatusLevelTable sLevelTableObj, UsageLevelTable uLevelTableObj)
paramValuesObj
- object that implements the parameter-values
interface.baseTimeVal
- base time value for cache (seconds since 1/1/1970).sLevelTableObj
- status-level table for cache.uLevelTableObj
- usage-level table for cache.public void startLevelsCachesPurgeThread(long levelsCacheSecs)
levelsCacheSecs
- maximum age for entries in cache, in seconds.public void stopLevelsCachesPurgeThread()
public java.lang.String getSnapshotStrFromCache(long dataTimeVal)
dataTimeVal
- desired time value for data, in seconds since
1/1/1970.
public Station getStationForDParam(DynamicParamHolder dParam)
dParam
- the dynamic parameter object.
public void procSameStatusLevel()
public StatusLevelTag getSameStatusLevel()
public long getSameStatusTime()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDisplayString(boolean cfgParamsFlag)
cfgParamsFlag
- if true then each station's information from
its table of configuration file parameters is also included.
public java.lang.String getDisplayString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |