1 package iotcode.interfaces;
4 import java.rmi.Remote;
5 import java.rmi.RemoteException;
8 import iotchecker.qual.NonLocalRemote;
10 /** Gateway public interface, e.g. for PhoneGateway
12 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
17 public interface WeatherGateway extends Remote {
19 /** Method to start the gateway.
25 public void start() throws RemoteException;
28 /** Method to stop the gateway.
34 public void stop() throws RemoteException;
37 /** Method to initialize the gateway.
39 * @return [void] None.
41 public void init() throws RemoteException;
44 /** Register an object to retrieve callbacks when new data is available.
46 * @param _callbackTo [WeatherGatewayCallback].
48 * @return [void] None.
50 public void registerCallback(@NonLocalRemote WeatherGatewayCallback _callbackTo) throws RemoteException;
53 /** Get inches per week data
57 * @return [double] Rainfall (inches per week).
59 public double getInchesPerWeek() throws RemoteException;
62 /** Get weather area zip code
66 * @return [int] Area zipcode.
68 public int getWeatherZipCode() throws RemoteException;
71 /** Days to keep watering the lawns
75 * @return [int] Number of days.
77 public int getDaysToWaterOn() throws RemoteException;
80 /** Get inches per minute data
84 * @return [double] Rainfall (inches per minute).
86 public double getInchesPerMinute() throws RemoteException;