edu.cmu.cs.able.gaugeInfrastructure
Interface GaugeReportingBus

All Known Implementing Classes:
RMIGaugeReportingBus, SienaGaugeReportingBus

public interface GaugeReportingBus

The gauge reporting bus is the bus on which a gauge reports events.


Method Summary
 boolean reportConfigured(GaugeID gauge, StringPairVector configParams)
          Called when a gauge has been configured.
 boolean reportCreated(GaugeID gauge)
          The first event produced by the gauge.
 boolean reportDeleted(GaugeID gauge)
          This event is sent as the last act of the gauge before it is destroyed.
 boolean reportMultipleValues(GaugeID gauge, GaugeValueVector values)
          Called by a gauge when it reports multiple values.
 boolean reportValue(GaugeID gauge, java.lang.String valueName, java.lang.String propertyName, java.lang.String value)
          Called by a gauge when it reports a value.
 void subscribeToGaugeEvent(GaugeEvent event, Subscriber subscriber)
          Called when an interested party is wants reports in some pattern.
 void unsubscribeToGaugeEvent(GaugeEvent event, Subscriber subscriber)
          Called to unregister a subscriber's interest in a gauge event pattern.
 

Method Detail

reportValue

public boolean reportValue(GaugeID gauge,
                           java.lang.String valueName,
                           java.lang.String propertyName,
                           java.lang.String value)
Called by a gauge when it reports a value. How often the gauge reports these values is determined by the gauge (although, it may be controlled through setup or configuration).
Parameters:
gauge - The gauge reporting the value.
valueName - The name of the value.
propertyName - The property with which the value is associated (established when the gauge is created)
value - The value being reported.
Returns:
whether the value was reported successfully.

reportMultipleValues

public boolean reportMultipleValues(GaugeID gauge,
                                    GaugeValueVector values)
Called by a gauge when it reports multiple values. How often the gauge reports these values is determined by the gauge (although, it may be controlled through setup or configuration).
Parameters:
gauge - The gauge reporting the values.
values - The values being reported - as (valueName, propertyName, value) tuples.
Returns:
true if the values where successfully reported; false otherwise.

reportConfigured

public boolean reportConfigured(GaugeID gauge,
                                StringPairVector configParams)
Called when a gauge has been configured. This should always be called when a guage is configured through its GaugeControl interface to let other interested parties know.
Parameters:
gauge - The gauge being configured.
configParams - The new configuration of the gauge - as (name, value) pairs.
Returns:
Whether the configuration was reported successfully.

reportDeleted

public boolean reportDeleted(GaugeID gauge)
This event is sent as the last act of the gauge before it is destroyed. It lets all interested parties know that the gauge will no longer report values.
Parameters:
gauge - The ID of the gauge being deleted.
Returns:
Whether the deletion was reported successfully.

reportCreated

public boolean reportCreated(GaugeID gauge)
The first event produced by the gauge. It lets interested parties know that a new gauge is about to report on the bus.
Parameters:
gauge - The ID of the new gauge.
Returns:
Whether the report was successfully sent.

subscribeToGaugeEvent

public void subscribeToGaugeEvent(GaugeEvent event,
                                  Subscriber subscriber)
Called when an interested party is wants reports in some pattern. Depending on the underlying implementation, this could allow browsers to register for any creation events, for example.
Parameters:
event - The event pattern to subscribe to.
subscriber - The object that contains a callback to call if the event pattern is matched.

unsubscribeToGaugeEvent

public void unsubscribeToGaugeEvent(GaugeEvent event,
                                    Subscriber subscriber)
Called to unregister a subscriber's interest in a gauge event pattern.
Parameters:
event - The event pattern to unsubscribe from. If this is null, then the subscriber is unsubscribed from all events.
subscriber - The subscriber to unsubscribe.