public class DynamicParamHolder
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable
Modifier | Constructor and Description |
---|---|
|
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.
|
Modifier and Type | Method and Description |
---|---|
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 |
getKey()
Gets the key for this dynamic parameter.
|
java.lang.String |
getName()
Returns parameter name, with preceding agent name.
|
java.lang.String |
getParamName()
Returns parameter name, without preceding agent name.
|
ParamValues |
getParamValues()
Get the parameter values.
|
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.
|
Station |
getStation()
Get the station.
|
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.
|
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.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 java.lang.String getKey()
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 ParamValues getParamValues()
public Station getStation()
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.