edu.cmu.cs.able.gauges
Class TimeGaugeImpl

java.lang.Object
  |
  +--edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
        |
        +--edu.cmu.cs.able.gauges.TimeGaugeImpl
All Implemented Interfaces:
java.lang.Runnable

public class TimeGaugeImpl
extends edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl


Fields inherited from class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
doReporting, gaugeBus, gaugeID, gaugeType, mappings, reportingFrequency, reportingThread, setupParams
 
Constructor Summary
TimeGaugeImpl(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeID gid, edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams, edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings, edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus bus)
          Creates a new instance of TimeGaugeImpl
 
Method Summary
 boolean configure(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams)
          This method is used to configure the gauge.
 boolean consistentlyCreated()
           
 boolean queryAllValues(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeValueVector values)
          Returns the current date.
 boolean queryState(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams, edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams, edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings)
          Returns the state of the gauge.
 java.lang.String queryValue(java.lang.String valueName)
          The method called to query the value of the gauge.
 void reportNewValue()
          This method is called periodically by the reporting thread to generate a new value and report it.
 
Methods inherited from class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
run, startReportingThread, stopReportingThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeGaugeImpl

public TimeGaugeImpl(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeID gid,
                     edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams,
                     edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings,
                     edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus bus)
Creates a new instance of TimeGaugeImpl
Method Detail

consistentlyCreated

public boolean consistentlyCreated()
Overrides:
consistentlyCreated in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl

configure

public boolean configure(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams)
This method is used to configure the gauge.
Overrides:
configure in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
Parameters:
configParams - The parameters used to configure the gauge. For the SienaTimeGauge, the valid configuration parameters are:
  frequency : int (millisecond period of reporting)
  report : true (whether the gauge should report a value)
Returns:
Whether the gauge was successfully configured.

queryAllValues

public boolean queryAllValues(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeValueVector values)
Returns the current date.
Overrides:
queryAllValues in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
Parameters:
values - The vector into which to place the date.
Returns:
Whether the gauge could report it's current value.

queryState

public boolean queryState(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams,
                          edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams,
                          edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings)
Returns the state of the gauge.
Overrides:
queryState in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
Parameters:
setupParams - The vector into which the setup parameters are copied. Will be empty for this gauge.
configParams - The configuration parameters for this gauge. Will have an element for
frequency
and
report
.
mappings - The property that each gauge value is associated with. Will have an element for
date
.
Returns:
Whether the state of the gauge could be queried.

queryValue

public java.lang.String queryValue(java.lang.String valueName)
The method called to query the value of the gauge. This provides a direct query for the gauge, as opposed to the gauge reporting to value on the bus.
Overrides:
queryValue in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl
Parameters:
valueName - The name of the value to query.
Returns:
The corresponding value of the gauge. (Note: it is assumed that the querier know the property associated with this value).

reportNewValue

public void reportNewValue()
This method is called periodically by the reporting thread to generate a new value and report it. It is inherited from Siena gauge.
Overrides:
reportNewValue in class edu.cmu.cs.able.gaugeInfrastructure.GaugeImpl