Question: In this lab, you are asked to program a client - server app for a simple business application about reserving a meeting room. To make
In this lab, you are asked to program a clientserver app for a simple business application about reserving a meeting room. To make it simple, we assume that there is just one meeting room and hour time slots from AM to PM Note that you are asked to use Java since it has the best cryptography package that is needed for later labs and the project.
Login
a When you start the app at the client side it will prompt you to login by inputting your username and password. The app will send the login information to the server side.
b The server will decrypt the received message using the same key as the client side. After the server parsed the decrypted message and determined that it is a login request, the server will compare the received username and password with the password information stored in a local file. i If the username does not exist or the password does not match, the server will send the client a login failure message. ii If the login succeeds, the server will send the client a list of time slots available for the meeting room if all slots are booked, the response message from the server to the client indicate no slots available for reservation.
c The client will make different processing upon the login response message from the server. i If login failed, it will allow the client to login again but not more than times in total. ii If login successful and there are slots available for reservation, the client will ask the user to choose the time slot to reserve. iii If login successful but no time slot available, the client side simply display the information about no time slots for reservation and exit the app.
Reserve
The client send a reserve message to the server. The server will check whether the requested slot is available or not. If yes, it will change the reservation status of the corresponding slot to unavailable and store the username as the party who reserve. Then it will notify the client that the reservation succeeds. If the requested slot is unavailable or the slot information is invalid, the server will notify the client that the reservation fails. The client can choose to ask the user make another reservation till the user decides to quit.
Requirements:
You need to design the protocol message format for login and reserve operations. Note that each protocol message should include method and message body. Write your protocol design as head comments for both client and server programs.
All protocol messages need to be encrypted using AES. You can initialize the key and IV in your code just need to make sure the client and the server are using the same key. At this stage you just need to work with one client, so no worry about managing multiple keys at the server.
Unless you are very familiar with Database and use of JDBC etc., you are recommended to use text files to manage the reservation, and username and password. In other words, it is assumed that you are familiar with basic file reading and writing operations in Java.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
