edu.cmu.cs.able.gaugeInfrastructure.RMI
Class RMIGaugeReportingBus

java.lang.Object
  |
  +--edu.cmu.cs.able.gaugeInfrastructure.RMI.RMIGaugeReportingBus
All Implemented Interfaces:
GaugeReportingBus, java.io.Serializable

public class RMIGaugeReportingBus
extends java.lang.Object
implements GaugeReportingBus, java.io.Serializable

RMIGaugeReportingBus is bus used to by the gauges, gauge managers and gauge consumers to report value or broadcast events.

Since:
JDK1.3.1
See Also:
Serialized Form

Constructor Summary
RMIGaugeReportingBus(java.lang.String host)
          Creates new RMIGaugeReportingBus
 
Method Summary
 void configureGauge(GaugeID theGaugeID, StringPairVector configParams)
           
 void createGauge(GaugeID theGaugeID, StringPairVector setupParams, StringPairVector mappings)
           
 void deleteGauge(GaugeID theGaugeID)
           
 java.lang.String getGaugeHost(GaugeID gid)
           
 java.lang.String getGaugeMgr(java.lang.String gaugeMgrType)
           
 void queryMetaInfo(java.lang.String gaugeType, StringPairVector configParamsMeta, StringPairVector valuesMeta)
           
 void registerGauge(GaugeID theGaugeID, StringPairVector setupParams, java.lang.String host)
           
 void registerGaugeConsumer(java.lang.String gaugeConsumerUID, int port)
           
 void registerGaugeMgr(java.lang.String gaugeMgrUID, java.lang.String gaugeMgrType, java.lang.String gaugeMgrHost)
           
 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 subscribeInterest(java.lang.String gaugeConsumerUID, GaugeID theGaugeID, GaugeEventType gaugeEvent)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RMIGaugeReportingBus

public RMIGaugeReportingBus(java.lang.String host)
                     throws java.rmi.RemoteException
Creates new RMIGaugeReportingBus
Method Detail

reportValue

public boolean reportValue(GaugeID gauge,
                           java.lang.String valueName,
                           java.lang.String propertyName,
                           java.lang.String value)
Description copied from interface: GaugeReportingBus
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).
Specified by:
reportValue in interface GaugeReportingBus
Following copied from interface: edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus
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)
Description copied from interface: GaugeReportingBus
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).
Specified by:
reportMultipleValues in interface GaugeReportingBus
Following copied from interface: edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus
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)
Description copied from interface: GaugeReportingBus
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.
Specified by:
reportConfigured in interface GaugeReportingBus
Following copied from interface: edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus
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)
Description copied from interface: GaugeReportingBus
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.
Specified by:
reportDeleted in interface GaugeReportingBus
Following copied from interface: edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus
Parameters:
gauge - The ID of the gauge being deleted.
Returns:
Whether the deletion was reported successfully.

reportCreated

public boolean reportCreated(GaugeID gauge)
Description copied from interface: GaugeReportingBus
The first event produced by the gauge. It lets interested parties know that a new gauge is about to report on the bus.
Specified by:
reportCreated in interface GaugeReportingBus
Following copied from interface: edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus
Parameters:
gauge - The ID of the new gauge.
Returns:
Whether the report was successfully sent.

subscribeToGaugeEvent

public void subscribeToGaugeEvent(GaugeEvent event,
                                  Subscriber subscriber)
Description copied from interface: GaugeReportingBus
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.
Specified by:
subscribeToGaugeEvent in interface GaugeReportingBus
Following copied from interface: edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus
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)
Description copied from interface: GaugeReportingBus
Called to unregister a subscriber's interest in a gauge event pattern.
Specified by:
unsubscribeToGaugeEvent in interface GaugeReportingBus
Following copied from interface: edu.cmu.cs.able.gaugeInfrastructure.GaugeReportingBus
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.

getGaugeHost

public java.lang.String getGaugeHost(GaugeID gid)

subscribeInterest

public void subscribeInterest(java.lang.String gaugeConsumerUID,
                              GaugeID theGaugeID,
                              GaugeEventType gaugeEvent)

registerGauge

public void registerGauge(GaugeID theGaugeID,
                          StringPairVector setupParams,
                          java.lang.String host)

registerGaugeMgr

public void registerGaugeMgr(java.lang.String gaugeMgrUID,
                             java.lang.String gaugeMgrType,
                             java.lang.String gaugeMgrHost)

configureGauge

public void configureGauge(GaugeID theGaugeID,
                           StringPairVector configParams)

createGauge

public void createGauge(GaugeID theGaugeID,
                        StringPairVector setupParams,
                        StringPairVector mappings)

deleteGauge

public void deleteGauge(GaugeID theGaugeID)

registerGaugeConsumer

public void registerGaugeConsumer(java.lang.String gaugeConsumerUID,
                                  int port)
                           throws java.rmi.RemoteException

getGaugeMgr

public java.lang.String getGaugeMgr(java.lang.String gaugeMgrType)

queryMetaInfo

public void queryMetaInfo(java.lang.String gaugeType,
                          StringPairVector configParamsMeta,
                          StringPairVector valuesMeta)