|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.trinetwatch.params.DynamicParamHolder
public class DynamicParamHolder
Class DynamicParamHolder holds a 'DynamicParameter' object and adds support for rule-set and time-received operations. All functions are thread-synchronized to allow only one thread access at a time.
Constructor Summary | |
---|---|
|
DynamicParamHolder(Station stationObj,
ParamValues paramValues,
DynamicParameter dParam,
AgentInfo agentObj,
CriteriaTable critTable,
long timeReceived)
Constructor which builds a new 'DynamicParamHolder' object from an existing 'DynamicParameter' object. |
|
DynamicParamHolder(Station stationObj,
ParamValues paramValues,
DynamicParameter dParam,
AgentInfo agentObj,
CriteriaTable critTable,
long timeReceived,
ArchiveParameterFlag archiveParameterFlag)
Constructor which builds a new 'DynamicParamHolder' object from an existing 'DynamicParameter' object. |
protected |
DynamicParamHolder(Station stationObj,
ParamValues paramValues,
DynamicParameter dParam,
AgentInfo agentObj,
CriteriaTable critTable,
long timeReceived,
java.lang.String holderName,
java.lang.Class dataClass,
ArchiveParameterFlag archiveParameterFlag)
Constructor which builds a new 'DynamicParamHolder' object from an existing 'DynamicParameter' object. |
|
DynamicParamHolder(Station stationObj,
ParamValues paramValues,
java.lang.String name,
java.lang.Object data,
AgentInfo agentObj,
CriteriaTable critTable,
long timeReceived)
Constructor which initializes all values from scratch. |
|
DynamicParamHolder(Station stationObj,
ParamValues paramValues,
java.lang.String name,
java.lang.Object data,
AgentInfo agentObj,
CriteriaTable critTable,
long timeReceived,
ArchiveParameterFlag archiveParameterFlag)
Constructor which initializes all values from scratch. |
Method Summary | |
---|---|
static java.lang.String |
buildHolderName(java.lang.String name,
AgentInfo agentObj)
Returns the parameter 'holder' names, which includes the agent name. |
boolean |
changeCriteriaTable(CriteriaTable critTable)
Changes the rule-set criteria table used by this dynamic parameter. |
void |
closeHistory()
Closes the history tracking for this parameter, releasing resources allocated by its archive manager. |
int |
compareTo(java.lang.Object obj)
Compares this object with the specified object 'obj'. |
AgentInfo |
getAgentObj()
Returns the agent information block object associated with the source agent for this parameter. |
ArchiveParameterFlag |
getArchiveParameterFlag()
Get the archive-parameter flag. |
CriteriaTable |
getCriteriaTable()
Returns the 'CriteriaTable' object for this parameter. |
java.lang.Object |
getData()
Returns data object. |
java.lang.Class |
getDataClass()
Returns the class object associated with the data object. |
protected static java.lang.Class |
getDataClass(CriteriaTable critTable)
Gets the data class. |
protected static java.lang.Class |
getDataClass(DynamicParameter dParam,
CriteriaTable critTable)
Gets the data class. |
protected static java.lang.Class |
getDataClass(java.lang.Object data,
CriteriaTable critTable)
Gets the data class. |
DataStatusBlock |
getDataSnapshot(long dataTimeVal,
long prefetchTimeVal,
UsageLevelTag uLevelTagObj)
Returns an historical "snapshot" of the parameter value at the given time value. |
DynamicParameter |
getDParameter()
Returns the handle of the DynamicParameter object held by this object. |
static boolean |
getHardHistoryFlag()
Determines whether or not 'SoftReference' objects are used with the parameter history Vectors. |
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 |
getHolderName(DynamicParameter dParam,
AgentInfo agentObj,
CriteriaTable critTable,
long timeReceived)
Gets the holder name. |
protected static java.lang.String |
getHolderName(java.lang.String name,
AgentInfo agentObj)
Gets the holder name. |
java.lang.String |
getName()
Returns parameter name, with preceding agent name. |
java.lang.String |
getParamName()
Returns parameter name, without preceding agent name. |
java.lang.Object |
getPrevDataValue()
Returns the previous data value for the dynamic parameter. |
StatusLevelTag |
getPrevStatusLevel(UsageLevelTag uLevel)
Returns the previous status level for the dynamic parameter. |
StatusLevelTag |
getStatusLevel(UsageLevelTag uLevel)
Returns current status level for the dynamic parameter. |
long |
getTimeLastChanged()
Returns the time of last change to the parameter value. |
static void |
setHardHistoryFlag(boolean flg)
Selects whether or not 'SoftReference' objects are used with the parameter history Vectors. |
void |
setTimeLastChanged(long timeVal)
Sets the time of last change to the parameter value. |
java.lang.String |
toString()
Returns string representation of data object. |
boolean |
updateFromNewestHistoryItem(long minTimeVal)
Updates the parameter with the newest item in the parameter's history (if available). |
boolean |
updateParamValue(java.lang.Object data,
long timeReceived)
Updates the data object of the dynamic parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected DynamicParamHolder(Station stationObj, ParamValues paramValues, DynamicParameter dParam, AgentInfo agentObj, CriteriaTable critTable, long timeReceived, java.lang.String holderName, java.lang.Class dataClass, ArchiveParameterFlag archiveParameterFlag)
stationObj
- the station object.paramValues
- parameter values.dParam
- 'DynamicParameter' object to build from.agentObj
- the agent information block object associated
with the source agent for this parameter.critTable
- rule-set criteria table for dynamic parameter.timeReceived
- timestamp for dynamic parameter, or 0 to use
current system time and not add initial value to history archive.holderName
- the holder name.dataClass
- the data class.archiveParameterFlag
- the archive-parameter flag.public DynamicParamHolder(Station stationObj, ParamValues paramValues, DynamicParameter dParam, AgentInfo agentObj, CriteriaTable critTable, long timeReceived, ArchiveParameterFlag archiveParameterFlag)
stationObj
- the station object.paramValues
- parameter values.dParam
- 'DynamicParameter' object to build from.agentObj
- the agent information block object associated
with the source agent for this parameter.critTable
- rule-set criteria table for dynamic parameter.timeReceived
- timestamp for dynamic parameter, or 0 to use
current system time and not add initial value to history archive.archiveParameterFlag
- the archive-parameter flag.public DynamicParamHolder(Station stationObj, ParamValues paramValues, DynamicParameter dParam, AgentInfo agentObj, CriteriaTable critTable, long timeReceived)
stationObj
- the station object.paramValues
- parameter values.dParam
- 'DynamicParameter' object to build from.agentObj
- the agent information block object associated
with the source agent for this parameter.critTable
- rule-set criteria table for dynamic parameter.timeReceived
- timestamp for dynamic parameter, or 0 to use
current system time and not add initial value to history archive.public DynamicParamHolder(Station stationObj, ParamValues paramValues, java.lang.String name, java.lang.Object data, AgentInfo agentObj, CriteriaTable critTable, long timeReceived, ArchiveParameterFlag archiveParameterFlag)
stationObj
- the station object.paramValues
- parameter values.name
- name of parameter.data
- data object, such as Integer, Double, String, etc.agentObj
- the agent information block object associated
with the source agent for this parameter.critTable
- rule-set criteria table for dynamic parameter.timeReceived
- timestamp for dynamic parameter, or 0 to use
current system time and not add initial value to history archive.archiveParameterFlag
- the archive-parameter flag.public DynamicParamHolder(Station stationObj, ParamValues paramValues, java.lang.String name, java.lang.Object data, AgentInfo agentObj, CriteriaTable critTable, long timeReceived)
stationObj
- the station object.paramValues
- parameter values.name
- name of parameter.data
- data object, such as Integer, Double, String, etc.agentObj
- the agent information block object associated
with the source agent for this parameter.critTable
- rule-set criteria table for dynamic parameter.timeReceived
- timestamp for dynamic parameter, or 0 to use
current system time and not add initial value to history archive.Method Detail |
---|
protected static java.lang.String getHolderName(java.lang.String name, AgentInfo agentObj)
name
- name of parameter.agentObj
- the agent information block object associated
with the source agent for this parameter.
protected static java.lang.String getHolderName(DynamicParameter dParam, AgentInfo agentObj, CriteriaTable critTable, long timeReceived)
dParam
- 'DynamicParameter' object to build from.agentObj
- the agent information block object associated
with the source agent for this parameter.critTable
- rule-set criteria table for dynamic parameter.timeReceived
- timestamp for dynamic parameter.
protected static java.lang.Class getDataClass(CriteriaTable critTable)
critTable
- rule-set criteria table for dynamic parameter.
protected static java.lang.Class getDataClass(DynamicParameter dParam, CriteriaTable critTable)
dParam
- 'DynamicParameter' object to build from.critTable
- rule-set criteria table for dynamic parameter.
protected static java.lang.Class getDataClass(java.lang.Object data, CriteriaTable critTable)
data
- data object, such as Integer, Double, String, etc.critTable
- rule-set criteria table for dynamic parameter.
public boolean changeCriteriaTable(CriteriaTable critTable)
critTable
- rule-set criteria table to use.
public boolean updateParamValue(java.lang.Object data, long timeReceived)
data
- data object, such as Integer, Double, String, etc.timeReceived
- the new timestamp for the dynamic parameter.
public java.lang.Class getDataClass()
public StatusLevelTag getStatusLevel(UsageLevelTag uLevel)
uLevel
- the current usage level of the dynamic parameter.
public DynamicParameter getDParameter()
public java.lang.String getName()
public java.lang.String getParamName()
public java.lang.Object getData()
public AgentInfo getAgentObj()
public CriteriaTable getCriteriaTable()
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
obj
- an object to compare to.
java.lang.ClassCastException
- if the specified object's type
prevents it from being compared to this object.public long getTimeLastChanged()
public void setTimeLastChanged(long timeVal)
timeVal
- new time of last change to the parameter value
(in seconds since January 1, 1970).public java.lang.Object getPrevDataValue()
public StatusLevelTag getPrevStatusLevel(UsageLevelTag uLevel)
uLevel
- the usage level of the dynamic parameter.
public java.util.Vector getHistoryVector(long startTime, long endTime)
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 updateFromNewestHistoryItem(long minTimeVal)
minTimeVal
- minimum-acceptable time value for update (seconds
since 1/1/1970).
public DataStatusBlock getDataSnapshot(long dataTimeVal, long prefetchTimeVal, UsageLevelTag uLevelTagObj)
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).uLevelTagObj
- usage level for determining status level, or
null for none.
public void closeHistory()
public ArchiveParameterFlag getArchiveParameterFlag()
public static boolean getHardHistoryFlag()
public static void setHardHistoryFlag(boolean flg)
flg
- if true then 'SoftReference' objects are used.public static java.lang.String buildHolderName(java.lang.String name, AgentInfo agentObj)
name
- name of parameter.agentObj
- the agent information block object associated
with the source agent for this parameter.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |