Problem Description: A distributed Hotel Booking system consists of the hotel server and the dient machine. The server m
Posted: Fri Jul 01, 2022 5:38 am
Programming Requirement: You are required to write this client-server hotel booking system program, which communicates via RMI. Specifically, your program should consist of two parts: one for the client and another for the server. The client (the customer) will initiate a request by sending request message to the hotel server to execute a specified procedure (e.g. booking) with parameters. Design Requirement: You can use the following interface and class definitions as a starting point for your project. However, you are free to develop your own interface and class definitions. 1- Interface public interface Hotellnterface extends Remote { public void book (int NumberOfGuests, int NumberOfNights, String CustomerName, Date checkinDate)throws RemoteException; public boolean cancelBooking (String CustomerName) throws RemoteException; public Date inquiry(String CustomerName) throws RemoteException; 2- Server public class HotelServer extends UnicastRemoteObject implements Hotelinterface { private Vector Customers; //guests' name private Vector CheckinDate; //guests' check-in Date private Vector NumOfNights; //guests' number of nights staying private Vector NumbOfGuest; // number of guests boolean done; public HotelServer() throws RemoteException { //implementation } public void book (int NumberOfGuests, int NumberOfNights, String CustomerName, Date checkinDate) throws Remote Exception ( //implementation }
public boolean cancelBooking/String CustomerName) throws RemoteException ( //implementation } public Date inquiry(String CustomerName) throws RemoteException 1 //implementation } public static void main(String args) throws Exception ( //init Hotel server) The Hotel server has only one input parameter "server port", which specifies the port of rmiregistry. The default port of rmiregistry is 1099, but we may have to use other ports, if 1099 has already been used by some other programs. 3- Customer (Client) public class Customer 1 public static void (String args[]) throws Exception ( //get user's input, and perform the operations The input parameters of a Customer must include: . server address: the address of the miregistry • server port the port of the rmiregistry • operation: one of "book", "cancelBooking", and "Inquiry" • CustomerName: assume it is unique for every user • CheckinDate: entered in the book operation • NumberOfNights: entered in the book operation • NumberOfGuests: entered in the book operation Grading: Implementing client-side (2 points) Implementing server-side (2 points) . Well-formed and documented code (1 Points) it332ksu.files.wordpress.com è