|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.trinetwatch.station.Station
public class Station
Class Station manages station-specific information.
Field Summary | |
---|---|
static java.lang.String |
statusParamName
Name of server-generated parameter for station status level. |
static java.lang.String |
usageParamName
Name of server-generated parameter for station usage level. |
Constructor Summary | |
---|---|
Station(java.lang.String shortName,
UsageLevelTag defaultUsageLevel,
RuleSet ruleSetObj)
Creates a new station object. |
|
Station(java.lang.String shortName,
UsageLevelTag defaultUsageLevel,
RuleSet ruleSetObj,
java.lang.String longName,
java.lang.String helpString,
java.util.Vector groupNamesVec)
Creates a new station object. |
|
Station(java.lang.String shortName,
UsageLevelTag defaultUsageLevel,
RuleSet ruleSetObj,
java.lang.String longName,
java.lang.String helpString,
java.util.Vector groupNamesVec,
StaticParamTable cfgParams)
Creates a new station object. |
Method Summary | |
---|---|
boolean |
addCfgParam(StaticParameter param)
Adds the given static parameter object to the configuration parameter table for the station. |
boolean |
addCfgParam(java.lang.String nameStr,
java.lang.String dataStr)
Creates a new StaticParameter object and adds it to the configuration parameter table for the station. |
boolean |
addStaticParam(StaticParameter param)
Adds the given static parameter object to the static parameter table for the station. |
boolean |
addStaticParam(java.lang.String nameStr,
java.lang.String dataStr)
Creates a new StaticParameter object and adds it to the static parameter table for the station. |
void |
changeRuleSet(RuleSet ruleSetObj)
Changes the rule set for this station. |
boolean |
checkSetControlFlag()
Attempts to set the control flag to indicate that a control operation is in progress. |
void |
clearControlFlag(java.lang.String message)
Clears the control flag to indicate that a control operation is no longer in progress. |
void |
closeParamHistories()
Closes the history tracking for the parameters for this station, releasing resources allocated by their archive managers. |
boolean |
compRuleSetName(java.lang.String name)
Compares the name associated with the current rule set for this station against the given name. |
boolean |
containsCfgParamKey(java.lang.String str)
Determines if the given parameter name key exists in the configuration parameter table. |
boolean |
containsDynamicParam(DynamicParamHolder dParam)
Determines if the given dynamic parameter holder object is held by this station. |
boolean |
containsStaticParamKey(java.lang.String str)
Determines if the given parameter name key exists in the static parameter table. |
void |
enterStationInfo(Station srcStationObj)
Enters updated information from the given 'Station' object into this object. |
ArchiveParameterFlag |
getArchiveParameterFlag(java.lang.String paramNameStr)
Get the archive-parameter flag for the given dynamic-parameter-name. |
java.lang.String |
getCacheLevelsAtTimeStr(long timeVal)
Returns a string containing the status and usage level names for the given time value, fetched from the levels cache. |
StaticParameter |
getCfgParam(java.lang.String str)
Returns the static parameter object associated with the given key in the configuration parameter table. |
StaticParamTable |
getCfgParams()
Returns the configuration parameters for the station. |
java.util.Enumeration |
getCfgParamsEnum()
Returns an enumeration of configuration parameters for the station. |
boolean |
getControlFlag()
Returns the control flag for the station. |
int |
getControlTimeoutSec()
Returns the timeout value (in seconds) associated with the usage control change operation in progress. |
java.lang.String |
getDisplayString()
Returns a display string containing information about the station and its basic fields. |
java.lang.String |
getDisplayString(boolean cfgParamsFlag)
Returns a display string containing information about the station and its various fields. |
boolean |
getDynamicCreatedFlag()
Determines if this station was dynamically created. |
DynamicParamHolder |
getDynamicParamHolder(java.lang.String str)
Returns the dynamic parameter holder object associated with the given key. |
java.util.Vector |
getDynamicParamsVec(long timeVal)
Returns a Vector of dynamic parameter objects for the station that have been updated. |
java.lang.String |
getGroupNamesString()
Returns a string of group names for the station. |
java.util.Vector |
getGroupNamesVec()
Returns the group names Vector for the station. |
java.lang.String |
getHelpString()
Returns the help string for the station. |
java.lang.String |
getLongName()
Returns the long name for the station. |
java.util.Vector |
getParamHistoryVec(java.lang.String paramName,
long startTime,
long endTime)
Returns (for the given parameter) a new Vector containing 'ValueTimeBlock' objects with timestamps in the specified range. |
StatusLevelTag |
getRawStatusLevel()
Returns the "raw" status level for this station. |
java.lang.String |
getShortName()
Returns the short name for the station. |
StaticParameter |
getStaticParam(java.lang.String str)
Returns the static parameter object associated with the given key in the static parameter table. |
java.util.Enumeration |
getStaticParamsEnum()
Returns an enumeration of static parameters for the station. |
long |
getStationTimeValue()
Returns the time of the last change to the station. |
StatusLevelTag |
getStatusLevel()
Returns the status level for the station. |
StatusLevelTag |
getStatusLevel(java.lang.String agentName)
Returns the status level for the station. |
DynamicParamHolder |
getStatusParamHolder()
Returns the parameter-holder object used to track status-level history. |
long |
getStatusUsageTimeValue()
Returns the time of the last change to the status or usage level for the station. |
long |
getStatusUsageTimeValue(java.lang.String agentName)
Returns the time of the last change to the status or usage level for this station's table of parameters for the given agent name. |
UsageLevelTag |
getUsageLevel()
Returns the usage level for the station. |
DynamicParamHolder |
getUsageParamHolder()
Returns the parameter-holder object used to track usage-level history. |
java.lang.String |
getUsageResultMsg()
Returns a message string for the client reporting the result of the last usage-control change request for this station. |
boolean |
hasHelpString()
Determines if the help string is available for the station. |
boolean |
hasLongName()
Determines if the long name is available for the station. |
boolean |
hasRuleSet()
Determines if the rule set is available for the station. |
boolean |
isParamInRuleSet(java.lang.String paramNameStr)
Determines if an entry for the given dynamic parameter name exists in the station's rule set. |
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 |
preloadAndEnableLevelsCache(ParamValues paramValuesObj,
long baseTimeVal,
StatusLevelTable sLevelTableObj,
UsageLevelTable uLevelTableObj)
Preloads the station-levels cache from the history archive and enables it. |
void |
purgeOldLevelsCacheEntries(long timeVal)
Purges entries from the station-levels cache that are older than the given time value. |
StaticParameter |
removeCfgParam(java.lang.String str)
Removes the static parameter object associated with the given key in the static parameter table. |
StaticParameter |
removeStaticParam(java.lang.String str)
Removes the static parameter object associated with the given key in the static parameter table. |
void |
setControlTimeoutSec(int val)
Sets the timeout value (in seconds) associated with the usage control change operation in progress. |
void |
setDynamicCreatedFlag()
Sets the dynamically-created-station flag to true. |
void |
setGroupNamesVec(java.util.Vector vec)
Sets the group names Vector for the station. |
void |
setHelpString(java.lang.String str)
Sets the help string for the station. |
void |
setLongName(java.lang.String str)
Sets the long name for the station. |
void |
setUsageLevel(ParamValues paramValuesObj,
UsageLevelTag uLevel)
Sets the usage level variable for this station. |
java.lang.String |
toString()
Returns the short station name. |
boolean |
updateDynamicParam(ParamValues paramValues,
DynamicParamHolder dParamHolderObj)
Updates or adds a parameter to the dynamic parameter table for the station. |
boolean |
updateDynamicParam(ParamValues paramValues,
java.lang.String nameStr,
java.lang.String dataStr,
AgentInfo agentObj)
Updates or adds a parameter to the dynamic parameter table for the station. |
protected boolean |
updateDynamicParam(ParamValues paramValues,
java.lang.String nameStr,
java.lang.String dataStr,
AgentInfo agentObj,
DynamicParamHolder dParamHolderObj)
Updates or adds a parameter to the dynamic parameter table for the station. |
protected void |
updateTimeValues()
Updates the time values. |
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 statusParamName
public static final java.lang.String usageParamName
Constructor Detail |
---|
public Station(java.lang.String shortName, UsageLevelTag defaultUsageLevel, RuleSet ruleSetObj, java.lang.String longName, java.lang.String helpString, java.util.Vector groupNamesVec, StaticParamTable cfgParams)
shortName
- short name for station (such as "ABC").defaultUsageLevel
- the default usage level or null if none.ruleSetObj
- rule-set object for station.longName
- long name for station.helpString
- help string for station.groupNamesVec
- a vector of String objects containing the
group names associated with the station.cfgParams
- a table of configuration parameters read from the
"stations_info.ini" file.public Station(java.lang.String shortName, UsageLevelTag defaultUsageLevel, RuleSet ruleSetObj, java.lang.String longName, java.lang.String helpString, java.util.Vector groupNamesVec)
shortName
- short name for station (such as "ABC").defaultUsageLevel
- the default usage level or null if none.ruleSetObj
- rule-set object for station.longName
- long name for station.helpString
- help string for station.groupNamesVec
- a vector of String objects containing the
group names associated with the station.public Station(java.lang.String shortName, UsageLevelTag defaultUsageLevel, RuleSet ruleSetObj)
shortName
- short name for station (such as "ABC").defaultUsageLevel
- the default usage level or null if none.ruleSetObj
- rule-set object for station.Method Detail |
---|
public void enterStationInfo(Station srcStationObj)
srcStationObj
- source 'Station' object to use.public boolean addCfgParam(java.lang.String nameStr, java.lang.String dataStr)
nameStr
- the name of the parameter.dataStr
- the data string for the parameter.
public boolean addCfgParam(StaticParameter param)
param
- the parameter.
public StaticParameter getCfgParam(java.lang.String str)
str
- a string matching the contents of the 'name' field
of the desired parameter object.
public boolean containsCfgParamKey(java.lang.String str)
str
- the parameter name key.
public StaticParameter removeCfgParam(java.lang.String str)
str
- a string matching the contents of the 'name' field
of the parameter object to be removed.
public StaticParamTable getCfgParams()
public java.util.Enumeration getCfgParamsEnum()
public boolean addStaticParam(java.lang.String nameStr, java.lang.String dataStr)
nameStr
- the name of the parameter.dataStr
- the data string for the parameter.
public boolean addStaticParam(StaticParameter param)
param
- the parameter.
public StaticParameter getStaticParam(java.lang.String str)
str
- a string matching the contents of the 'name' field
of the desired parameter object.
public boolean containsStaticParamKey(java.lang.String str)
str
- the parameter name key.
public StaticParameter removeStaticParam(java.lang.String str)
str
- a string matching the contents of the 'name' field
of the parameter object to be removed.
public java.util.Enumeration getStaticParamsEnum()
protected boolean updateDynamicParam(ParamValues paramValues, java.lang.String nameStr, java.lang.String dataStr, AgentInfo agentObj, DynamicParamHolder dParamHolderObj)
paramValues
- parameter values.nameStr
- the name of the dynamic parameter.dataStr
- the data string for the dynamic parameter.agentObj
- the agent information block object associated
with the source agent for this parameter.dParamHolderObj
- dynamic-parameter holder object to use, or
null to create a new one.
public boolean updateDynamicParam(ParamValues paramValues, java.lang.String nameStr, java.lang.String dataStr, AgentInfo agentObj)
paramValues
- parameter values.nameStr
- the name of the dynamic parameter.dataStr
- the data string for the dynamic parameter.agentObj
- the agent information block object associated
with the source agent for this parameter.
public boolean updateDynamicParam(ParamValues paramValues, DynamicParamHolder dParamHolderObj)
paramValues
- parameter values.dParamHolderObj
- dynamic-parameter holder object to use.
public DynamicParamHolder getDynamicParamHolder(java.lang.String str)
str
- a string matching the contents of the 'name' field
of the desired parameter object.
public boolean containsDynamicParam(DynamicParamHolder dParam)
dParam
- the dynamic parameter.
public StatusLevelTag getStatusLevel(java.lang.String agentName)
agentName
- the name of agent use to fetch the status
level, or null to fetch the status level for the station.
public StatusLevelTag getStatusLevel()
public StatusLevelTag getRawStatusLevel()
public boolean compRuleSetName(java.lang.String name)
name
- the name to compare against.
public void changeRuleSet(RuleSet ruleSetObj)
ruleSetObj
- the new rule set object to use.public java.util.Vector getDynamicParamsVec(long timeVal)
timeVal
- only dynamic parameter objects with timestamps
greater than this value are returned.
public java.util.Vector getParamHistoryVec(java.lang.String paramName, long startTime, long endTime)
paramName
- the name of specified parameter.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 DynamicParamHolder getStatusParamHolder()
public DynamicParamHolder getUsageParamHolder()
protected void updateTimeValues()
public long getStationTimeValue()
public long getStatusUsageTimeValue()
public long getStatusUsageTimeValue(java.lang.String agentName)
agentName
- the agent name.
public boolean isParamInRuleSet(java.lang.String paramNameStr)
paramNameStr
- parameter name to use.
public ArchiveParameterFlag getArchiveParameterFlag(java.lang.String paramNameStr)
paramNameStr
- name of dynamic parameter.
public java.lang.String getShortName()
public java.lang.String getLongName()
public boolean hasHelpString()
public boolean hasLongName()
public boolean hasRuleSet()
public void setLongName(java.lang.String str)
str
- the long name.public java.lang.String getHelpString()
public void setHelpString(java.lang.String str)
str
- the help string.public java.util.Vector getGroupNamesVec()
public void setGroupNamesVec(java.util.Vector vec)
vec
- vector of grup names.public java.lang.String getGroupNamesString()
public UsageLevelTag getUsageLevel()
public void setUsageLevel(ParamValues paramValuesObj, UsageLevelTag uLevel)
paramValuesObj
- object that implements the parameter-values
interface, or null for none.uLevel
- the new usage level for this station; a value of
'null' is translated to 'UsageLevelTag.undefinedUsageTag'.public void setControlTimeoutSec(int val)
val
- the timeout value.public int getControlTimeoutSec()
public boolean getControlFlag()
public boolean checkSetControlFlag()
public void clearControlFlag(java.lang.String message)
message
- a message string for the client reporting the result
of the usage-control change request. This string is returned by
the 'getUsageResultMsg()' method.public java.lang.String getUsageResultMsg()
public java.lang.String toString()
toString
in class java.lang.Object
public void setDynamicCreatedFlag()
public boolean getDynamicCreatedFlag()
public java.lang.String getDisplayString(boolean cfgParamsFlag)
cfgParamsFlag
- if true then information from the table of
configuration file parameters is also included.
public java.lang.String getDisplayString()
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 preloadAndEnableLevelsCache(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 java.lang.String getCacheLevelsAtTimeStr(long timeVal)
timeVal
- requested time value (seconds since 1/1/1970).
public void purgeOldLevelsCacheEntries(long timeVal)
timeVal
- purge time value (seconds since 1/1/1970).public void closeParamHistories()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |