edu.cmu.cs.able.gauges.Siena
Class SienaTimeGauge
java.lang.Object
|
+--edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
|
+--edu.cmu.cs.able.gauges.Siena.SienaTimeGauge
- All Implemented Interfaces:
- edu.cmu.cs.able.gaugeInfrastructure.GaugeControl
- public class SienaTimeGauge
- extends edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
This gauge provides an example that periodically reports
the date and time to the gauge bus. Its type is:
TimeGauge = [
type = edu.cmu.cs.able.gauges.Siena.SienaTimeGauge,
setup = []
config = [frequency : int; report : boolean [default = false;]]
values = [date : String]
Field Summary |
protected java.lang.String |
gaugeType
|
Fields inherited from class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge |
gaugeBus, mappings, myManagerID, setupParams |
Constructor Summary |
SienaTimeGauge(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeID gaugeID,
java.lang.String creatorID,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings)
Creates new SienaTimeGauge |
Method Summary |
boolean |
configure(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams)
The method called when configuring a gauge. |
static void |
main(java.lang.String[] args)
A command-line interface to start the gauge. |
boolean |
queryAllValues(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeValueVector values)
Returns all the gauge values that the gauge reports. |
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)
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. |
Methods inherited from class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge |
finalizeCreation, finalizeDeletion, getGaugeID, processDelete, setGaugeID |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
gaugeType
protected java.lang.String gaugeType
SienaTimeGauge
public SienaTimeGauge(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeID gaugeID,
java.lang.String creatorID,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams,
edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings)
- Creates new SienaTimeGauge
- Parameters:
gaugeID
- The ID of the new gauge.creatorID
- The ID of the gauge manager that created the gauge.setupParams
- The parameters that the gauge uses to set itself up. The
valid setup parameters for this gauge are:
frequency : intmappings
- The property that the date
value is associated with.
configure
public boolean configure(edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParams)
- Description copied from class:
edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- The method called when configuring a gauge.
- Overrides:
configure
in class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- Following copied from class:
edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- Parameters:
configParams
- The configuration parameters for the gauge as (name, value) pairs.- Returns:
- true if the gauge could be configured successfully; false otherwise
queryAllValues
public boolean queryAllValues(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeValueVector values)
- Description copied from class:
edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- Returns all the gauge values that the gauge reports.
- Overrides:
queryAllValues
in class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- Following copied from class:
edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- 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.
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)
- Description copied from class:
edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- The method called to query the state of the gauge
- Overrides:
queryState
in class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- Following copied from class:
edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- 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) pairsmappings
- 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)
- Description copied from class:
edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- Called when a gauge is queried for a value. This provides an
alternative to the gauge reporting events.
- Overrides:
queryValue
in class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- Following copied from class:
edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
- 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.
main
public static void main(java.lang.String[] args)
- A command-line interface to start the gauge.
- Parameters:
args
- -gt gauge type
-gn gauge name
-mt model type
-mn model name
[-setup name=value]
[-mappings name=property]
-creator creator ID
-senp siena port
[-debug]