stella.rmi
Interface RmiWeatherReporting

All Superinterfaces:
Remote, RmiCaster, RmiPropertyBearing, RmiWeatherCaster
All Known Implementing Classes:
SimulatorWeather, WeatherStation

public interface RmiWeatherReporting
extends RmiPropertyBearing, RmiWeatherCaster

The interface describing key properties of an object capable of watching the weather and throwing WeatherEvents on condition change. A waether watcher must therefore act as a RmiWeatherCaster. Additionally to normal weather casting capabilities, this class should send the current weather on newly added RmiWeatherListeners. A weather watcher will always consists of weather sensors, accordingly a method is defined to retrieve a single data sensor by name, getDataSensor(java.lang.String). Retriving the entire Collection of sensor names is possible with getAllSensorNames().


Field Summary
 
Fields inherited from interface stella.rmi.RmiWeatherCaster
NAMING_EXTENSION
 
Method Summary
 boolean addSensor(String prop)
          Adds a sensor with the given properties file.
 Collection getAllSensorNames()
          Returns a reference collection to all weather sensor in this weather watcher as a collection of rmi data casters.
 RmiDataCaster getDataSensor(String name)
          Returns a reference to the (running) instance of the weather sensor with the given name.
 String getStatus()
          Returns a status description of the weather station.
 boolean removeSensor(String name)
          Removes the sensor with the given name.
 
Methods inherited from interface util.rmi.RmiPropertyBearing
containsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemoteProperty
 
Methods inherited from interface stella.rmi.RmiWeatherCaster
addRmiWeatherListener, removeRmiWeatherListener
 
Methods inherited from interface util.rmi.RmiCaster
bindToRegistry, isValid, unbindFromRegistry
 

Method Detail

getDataSensor

RmiDataCaster getDataSensor(String name)
                            throws RemoteException
Returns a reference to the (running) instance of the weather sensor with the given name. Note that the name must be unique.

Throws:
RemoteException

getAllSensorNames

Collection getAllSensorNames()
                             throws RemoteException
Returns a reference collection to all weather sensor in this weather watcher as a collection of rmi data casters.

Throws:
RemoteException

removeSensor

boolean removeSensor(String name)
                     throws RemoteException
Removes the sensor with the given name. This includes deregistering from the sensor (weather station only). The sensor still remains active and might even deliver data to other processes.

Returns:
True on success.
Throws:
RemoteException

addSensor

boolean addSensor(String prop)
                  throws RemoteException
Adds a sensor with the given properties file. This includes initialization of the sensor, registering side information and registering serial servers if the sensor is stella.io.DriverDepending. The weather station registers itself as a weather listener to the sensor.

Returns:
True on success.
Throws:
RemoteException

getStatus

String getStatus()
                 throws RemoteException
Returns a status description of the weather station. This should indicate current weather conditions together with readings of the individual sensors.

Throws:
RemoteException