import net.jini.core.event.EventRegistration; import net.jini.core.event.RemoteEventListener; import java.io.Serializable; import java.rmi.MarshalledObject; import java.rmi.Remote; import java.rmi.RemoteException; import java.util.ArrayList; import java.util.LinkedList; /** * The HealthSpa remote interface * * @author Cormac Redmond -- credmond85 /at/ gmail */ public interface HealthSpaInterface extends Remote, Serializable { // Gets list of rooms available (their name and code). LinkedList getRoomList() throws RemoteException; // Gets list of all staff available (their name and code). LinkedList getStaffList() throws RemoteException; // Gets list (their name and code) of all staff available at a particular time. LinkedList getStaffAvailableList(int hour, int day, int week) throws RemoteException; // Gets list of members. Admin only. LinkedList getMemberList(String adminUsername, String adminPassword) throws RemoteException; // Gets the timetable of a room for a certain period. boolean[] getRoomTimetableForPeriod(String roomCode, int hour, int week) throws RemoteException; // Creates a booking for a given period. Logged in users only. int makeBooking(String roomCode, String memberCode, String staffCode, String username, String password, int hour, int day, int week) throws RemoteException; // Cancels a booking. Logged in in users only. int cancelBooking(Booking tempBooking, String memberCode, String username, String password) throws RemoteException; // Returns a ModelObject containing some user data on a successful login. ModelObject userLogin(String username, String password) throws RemoteException; // A helper utility to see if the logged in user is an admin. boolean isUserAdmin(String memberCode) throws RemoteException; // Gets the roster of a particular staff member, for a particular week. boolean[][] getStaffRoster(String staffCode, int week) throws RemoteException; // Gets booking information for a member. Admins can request any, a user can only request his own. ArrayList getMemberBookingInfo(String username, String password, String memberCode) throws RemoteException; // Adds a user to the system. Admin only. int addUser(String adminUsername, String adminPassword, String newMemberUsername, String newMemberPassword, String newMemberName) throws RemoteException; // Records the payment of a user. Admin only. int recordPayment(String adminUsername, String adminPassword, String memberCode, int bookingNo) throws RemoteException; // Changes the password of a user. int changePassword(String memberCode, String memberUsername, String memberCurrentPasssword, String memberNewPassword) throws RemoteException; // Sets the price of a room. Admin only. int setPrice(String adminUsername, String adminPassword, String roomCode, double newPrice) throws RemoteException; // Registers client for notification of a cancellation. public EventRegistration registerForCancellationEvents(int hour, int day, int week, String roomCode, MarshalledObject data, RemoteEventListener listener, long duration) throws RemoteException; }