edu.cmu.cs.able.gauges.Siena
Class SienaBandwidthGauge

java.lang.Object
  |
  +--edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
        |
        +--edu.cmu.cs.able.gauges.Siena.SienaBandwidthGauge
All Implemented Interfaces:
BandwidthProbeConsumer, GaugeControl, java.lang.Runnable

public class SienaBandwidthGauge
extends SienaGauge
implements BandwidthProbeConsumer

This class implements a BandwidthGauge, and uses RemosProbes to determine the current bandwidth. It is assumed that a RemosProbe is listening on the siena bus. The gauge type for this gauge is:
BandwidthGauge = [
  type = edu.cmu.cs.able.gauges.Siena.SienaBandwidthGauge
  setup = [IP_addr1 : String = "localhost"; IP_addr2 = "localhost"; Frequency : long = 100]
  config = [Frequency : long = 100]
  values = [bandwidth : float]


Field Summary
protected  java.lang.Double currentBW
          The bandwidth that was currently measured from the probe.
protected  int frequency
          How often this gauge should report the bandwidth.
protected  java.lang.String gaugeType
          The type of the BandwidthGauge (edu.cmu.cs.able.gauges.Siena.SienaBandwidthGauge)
protected  java.net.InetAddress ip1
          The IP address of one endpoint to determine the bandwidth between.
protected  java.net.InetAddress ip2
          The IP address of one endpoint to determine the bandwidth between.
static java.lang.String senp
          The location of the siena bus server.
 
Fields inherited from class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
doReporting, gaugeBus, mappings, myManagerID, setupParams, sleepTime
 
Constructor Summary
SienaBandwidthGauge(GaugeID gaugeID, java.lang.String creatorID, StringPairVector setupParams, StringPairVector mappings)
          Creates new SienaBandwidthGauge
 
Method Summary
 boolean configure(StringPairVector configParams)
          Configures the gauge.
static void main(java.lang.String[] args)
          A command-line interface to start the gauge.
 boolean queryAllValues(GaugeValueVector values)
          Returns all the values that this gauge reports.
 boolean queryState(StringPairVector setupParams, StringPairVector configParams, StringPairVector mappings)
          Returns the state of this gauge.
 java.lang.String queryValue(java.lang.String valueName)
          Returns the value of a particular value name
 void reportNewValue()
          Reports a new value.
 void sensed(double bw)
          The callback that implements BandwidthProbeConsumer.
 
Methods inherited from class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGauge
finalizeCreation, finalizeDeletion, getGaugeID, processDelete, run, setGaugeID, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gaugeType

protected java.lang.String gaugeType
The type of the BandwidthGauge (edu.cmu.cs.able.gauges.Siena.SienaBandwidthGauge)

ip1

protected java.net.InetAddress ip1
The IP address of one endpoint to determine the bandwidth between.

ip2

protected java.net.InetAddress ip2
The IP address of one endpoint to determine the bandwidth between.

frequency

protected int frequency
How often this gauge should report the bandwidth.

currentBW

protected java.lang.Double currentBW
The bandwidth that was currently measured from the probe.

senp

public static java.lang.String senp
The location of the siena bus server.
Constructor Detail

SienaBandwidthGauge

public SienaBandwidthGauge(GaugeID gaugeID,
                           java.lang.String creatorID,
                           StringPairVector setupParams,
                           StringPairVector mappings)
Creates new SienaBandwidthGauge
Parameters:
gaugeID - The ID of the gauge to create.
creatorID - The ID of the gauge manager that is creating the gauge.
setupParams - The value of the setup params, with items for IP_addr1, IP_addr2, and Frequency.
mappings - The definition of the mapping between the bandwidth value and a model.
Method Detail

configure

public boolean configure(StringPairVector configParams)
Configures the gauge.
Overrides:
configure in class SienaGauge
Parameters:
configParams - The configuration parameters for this gauge.
Returns:
 

queryAllValues

public boolean queryAllValues(GaugeValueVector values)
Returns all the values that this gauge reports.
Overrides:
queryAllValues in class SienaGauge
Parameters:
values - Filled with an entry for bandwidth, with the value of the currentBW.
Returns:
 

queryState

public boolean queryState(StringPairVector setupParams,
                          StringPairVector configParams,
                          StringPairVector mappings)
Returns the state of this gauge.
Overrides:
queryState in class SienaGauge
Parameters:
setupParams - The parameters that the gauge was setup with.
configParams - The current configuration of the gauge.
mappings - The current mappings of the gauge.
Returns:
 

queryValue

public java.lang.String queryValue(java.lang.String valueName)
Returns the value of a particular value name
Overrides:
queryValue in class SienaGauge
Parameters:
valueName - The name of the value to return.
Returns:
The gauge value

reportNewValue

public void reportNewValue()
Reports a new value. This should be overridden by extenders of this gauge.
Overrides:
reportNewValue in class SienaGauge

sensed

public void sensed(double bw)
The callback that implements BandwidthProbeConsumer. This is called when the RemosProbe reports a value.
Specified by:
sensed in interface BandwidthProbeConsumer
Parameters:
bw - The bandwidth reported by the RemosProbe.

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]