edu.cmu.cs.able.gaugeInfrastructure.Siena
Class SienaGaugeHandle

java.lang.Object
  |
  +--edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGaugeHandle
All Implemented Interfaces:
GaugeControl

public class SienaGaugeHandle
extends java.lang.Object
implements GaugeControl

The proxy implementation of a Siena gauge. Objects of this class are held by gauge consumers who interact directly with the gauge through this control interface. Note, however, that gauge consumers get event-based reports by implementing the GaugeConsumer interface and registering with the gauge bus.


Constructor Summary
SienaGaugeHandle(GaugeID gid)
          Creates new SienaGaugeHandle
 
Method Summary
 boolean configure(StringPairVector configParams)
          The method called when configuring a gauge.
 GaugeID getGaugeID()
          Returns the ID of the gauge that this is a handle for.
 boolean queryAllValues(GaugeValueVector values)
          Queries the gauge for all values that the gauge reports.
 boolean queryState(StringPairVector setupParams, StringPairVector configParams, StringPairVector mappings)
          Returns the state of the gauge.
 java.lang.String queryValue(java.lang.String valueName)
          Called when a gauge is queried for a value.
 void registerGaugeConsumer(GaugeConsumer consumer)
           
 void setGaugeID(GaugeID gaugeID)
          Sets the ID of the gauge handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SienaGaugeHandle

public SienaGaugeHandle(GaugeID gid)
Creates new SienaGaugeHandle
Parameters:
gid - This ID of the gauge that will be managed by this gauge manager.
Method Detail

getGaugeID

public GaugeID getGaugeID()
Returns the ID of the gauge that this is a handle for.
Specified by:
getGaugeID in interface GaugeControl
Returns:
 

setGaugeID

public void setGaugeID(GaugeID gaugeID)
Sets the ID of the gauge handle.
Parameters:
gaugeID - The Gauge ID

queryAllValues

public boolean queryAllValues(GaugeValueVector values)
Queries the gauge for all values that the gauge reports. This publishes a request on the Siena bus and waits for a reply from the gauge.
Specified by:
queryAllValues in interface GaugeControl
Parameters:
values - Will be filled with a (name, property, value) tuple for each value the gauge reports.
Returns:
Whether the values were successfully retrieved from the gauge.

queryState

public boolean queryState(StringPairVector setupParams,
                          StringPairVector configParams,
                          StringPairVector mappings)
Returns the state of the gauge. Publishes a request on the bus and waits for a reply from the actual gauge.
Specified by:
queryState in interface GaugeControl
Parameters:
setupParams - The (name, value) pairs that the gauge was setup with.
configParams - The (name, value) pairs of the configuration of the gauge.
mappings - The (value, property) pairs for each gauge value mapping.
Returns:
Whether the information was successfully retrieved from the gauge.

queryValue

public java.lang.String queryValue(java.lang.String valueName)
Description copied from interface: GaugeControl
Called when a gauge is queried for a value. This provides an alternative to the gauge reporting events.
Specified by:
queryValue in interface GaugeControl
Following copied from interface: edu.cmu.cs.able.gaugeInfrastructure.GaugeControl
Parameters:
valueName - The name of the value to be queried.
Returns:
The value corresponding to the name passed in; null indicates that the gauge value could not be determined.

configure

public boolean configure(StringPairVector configParams)
Description copied from interface: GaugeControl
The method called when configuring a gauge.
Specified by:
configure in interface GaugeControl
Following copied from interface: edu.cmu.cs.able.gaugeInfrastructure.GaugeControl
Parameters:
configParams - The configuration parameters for the gauge as (name, value) pairs.
Returns:
true if the gauge could be configured successfully; false otherwise

registerGaugeConsumer

public void registerGaugeConsumer(GaugeConsumer consumer)