edu.cmu.cs.able.gaugeInfrastructure
Interface GaugeControl

All Known Implementing Classes:
RMIGauge, RMIGaugeHandle, SienaGauge, SienaGaugeMgrGaugeHandle, SienaGaugeHandle

public interface GaugeControl

The GaugeControl interface specifies the point-to-point control interface for a gauge. Each gauge must implement this interface. Each infrastructure implementation will likely include two implementations of this interface - an handle that can be used by consumers to control the gauge and a gauge that is the actual gauge implementation.


Method Summary
 boolean configure(StringPairVector configParams)
          The method called when configuring a gauge.
 GaugeID getGaugeID()
          Each gauge implementation must have an ID
 boolean queryAllValues(GaugeValueVector values)
          Returns all the gauge values that the gauge reports.
 boolean queryState(StringPairVector setupParams, StringPairVector configParams, StringPairVector mappings)
          The method called to query the state of the gauge
 java.lang.String queryValue(java.lang.String valueName)
          Called when a gauge is queried for a value.
 

Method Detail

getGaugeID

public GaugeID getGaugeID()
Each gauge implementation must have an ID
Returns:
The ID of the gauge

configure

public boolean configure(StringPairVector configParams)
The method called when configuring a gauge.
Parameters:
configParams - The configuration parameters for the gauge as (name, value) pairs.
Returns:
true if the gauge could be configured successfully; false otherwise

queryState

public boolean queryState(StringPairVector setupParams,
                          StringPairVector configParams,
                          StringPairVector mappings)
The method called to query the state of the gauge
Parameters:
setupParams - Will be filled with the parameters with which the gauge was setup, as (name, value) pairs.
configParams - Will be filled with the current configuration of the gauge, as (name, value) pairs
mappings - Will be filled with the mappings for the gauge, as (name, propertyName) pairs.
Returns:
true if the gauge successfully returns its state; false otherwise

queryValue

public java.lang.String queryValue(java.lang.String valueName)
Called when a gauge is queried for a value. This provides an alternative to the gauge reporting events.
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.

queryAllValues

public boolean queryAllValues(GaugeValueVector values)
Returns all the gauge values that the gauge reports.
Parameters:
values - This is filled with all the values as a (valueName, propertyName, value) tuple
Returns:
true if the values were successfully determined; false otherwise.