|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.isam.exehda.services.primos.MetaSensor
Facility to manipulate sensors. Each sensor is broken in a public version and another private one. The private version is used to interact with the underlaying monitor (actual sensor's provider). The public sensor is made publically available to applications and may be used with no risk of opening security flaws or having unwanted side-effects.
Constructor Summary | |
MetaSensor(Collector.Sensor pvtSensor,
Collector.Monitor provider)
Creates a new MetaSensor instance for the given private Sensor
and monitor. |
Method Summary | |
void |
addConsumer(Collector.ConsumerId c)
Register a new consumer for the sensor. |
boolean |
checkStateChanged()
Returns whether the sensor value has significantly changed since last publication. |
java.lang.Object |
getKey()
Returns the public key os this sensor. |
java.lang.Object |
getParameter(Collector.SensorParameter p)
Returns the current value assigned to the given parameter. |
Collector.SensorParameter[] |
getParameters()
Returns the list of parameters supported by this sensor. |
Collector.Monitor |
getProvider()
Returns the underlaying monitor who actually provides this sensor. |
Collector.Sensor |
getPublicSensor()
Returns the public sensor object associated with this sensor. |
boolean |
isEnabled()
Returns whether this sensor is currently enabled or not. |
Collector.MonitoringData |
probe(Collector.MonitoringData d)
Probes the current value of the sensor. |
void |
removeConsumer(Collector.ConsumerId c)
Unregisters the given object as a consumer of the data produced by this sensor. |
void |
setEnabled(boolean enable)
Enables/disables this sensor. |
void |
setParameter(Collector.ConsumerId c,
Collector.SensorParameter p,
java.lang.Object v)
Assigns a new value to the given parameter. |
java.lang.String |
toString()
Returns a string representation of this MetaSensor object (mostly for debugging purpouses). |
void |
update(long timeStamp)
Updates last published state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MetaSensor(Collector.Sensor pvtSensor, Collector.Monitor provider)
MetaSensor
instance for the given private Sensor
and monitor.
pvtSensor
- an internal Sensorprovider
- the underlaying sensor providerMethod Detail |
public Collector.Sensor getPublicSensor()
public java.lang.Object getKey()
public void update(long timeStamp)
public boolean checkStateChanged()
boolean
valuepublic void addConsumer(Collector.ConsumerId c)
c
- a new Consumerpublic void removeConsumer(Collector.ConsumerId c)
c
- a ConsumerId
valuepublic void setEnabled(boolean enable)
enable
- a boolean
valuepublic boolean isEnabled()
public Collector.SensorParameter[] getParameters()
SensorParameter[]
valuepublic java.lang.Object getParameter(Collector.SensorParameter p)
p
- a SensorParameter
value
Object
valuepublic void setParameter(Collector.ConsumerId c, Collector.SensorParameter p, java.lang.Object v)
c
- a ConsumerId
valuep
- a SensorParameter
valuev
- an Object
valuepublic Collector.MonitoringData probe(Collector.MonitoringData d)
d
- a MonitoringData
value
MonitoringData
valuepublic Collector.Monitor getProvider()
public java.lang.String toString()
toString
in class java.lang.Object
String
value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |