Problem Description A Distributed Hotel Booking System Consists Of The Hotel Server And The Dient Machine The Server M 1 (31.74 KiB) Viewed 29 times
Problem Description A Distributed Hotel Booking System Consists Of The Hotel Server And The Dient Machine The Server M 2 (38.5 KiB) Viewed 29 times
Problem Description A Distributed Hotel Booking System Consists Of The Hotel Server And The Dient Machine The Server M 3 (38.5 KiB) Viewed 29 times
Problem Description A Distributed Hotel Booking System Consists Of The Hotel Server And The Dient Machine The Server M 4 (30.12 KiB) Viewed 29 times
Problem Description: A distributed Hotel Booking system consists of the hotel server and the dient machine. The server manages hotel rooms booking information. A customer can invoke the following operations at his machine 1- public void book fint NumberOfGuests, int NumberOfNights, String Customerome Dete checkejchrow Remotexception, // this operation will book a room for the specific guest and return nothing 2- public booleon cancelBookingString CustomerNamethrowexception // this operation cancels the booking of a user, and returns true if the booking was canceled successfully 3 public Date inquiryString CustomerNome) throws Remotexception // this operation returns the check-in date for customer. Programming Requirement: You are required to write this cient server hotel booking system program, which communicates via RML 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 leg. 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 Hotel interface extends Remote T public void book (int NumberOfGuests, int NumberOfNights, String CustomerName, Date checkinDateithrows RemoteException, public boolean cancellookingString CustomerName) throws RemoteException public Date inquiryString CustomerName) throws RemoteException 1 2- Server public class HoteServer extends UnicastRemoteObject implements HotelInterface 1 private Vector Customers guests' name private Vector CheckinDate: //guests check is Date private Vector Nurofights //guests' number of nights staying private Vector Numb Of Guest//number of guests boolean done; public HotelServer() throws Remotexception ( Amplementation 1 public void book (nt NumberOfGuests, int NumberONights, String Customename, Date checkinDate) throws Remote aception 1 //mplementation |
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 è
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!