For this project, you are to use Java-RMI to redo the application from Project 1 with a few differences.
In Feb 2011, RMIC was located at:
/usr/java/jdk1.6.0_07/bin/rmicon the CS machines.
For this project, you are to use the Java sockets API to create a distributed application that will allow a company to keep track of reservations for some events. The project will not not require any form of stored database. If the server stops/crashes, all data can be lost. We will worry about this aspect in future projects. (If you wish to store/restore the database, you are more than welcome to; however, that is not a requirement of this project.)
The Server for this project will just need to maintain the database and handle connections from the clients. The server is to allow multiple clients to be able to connect simultaneously. The server also needs to be able to generate unique values for the the Event numbers and unique values for the Reservation numbers. Using an integer that increments each time a new number is requested is sufficient for this requirement.
There will be two forms of clients for this project. A Manager Client and an Agent Client.
The Agent Client is the simpler of the two. It will allow the following operations:
User Input: view
This command will request from the server and display for the user all of the current events on the system. For each event, it is to display:
User Input: reserve
event_number space_amount person_name, e.g. reserve 5 10 Sol
When making a reservation, a valid Event Number is entered along with the amount of space requested and the name of the person making the reservation. The server must verify that the Event Number is valid and has the available amount of space. If so, a unique confirmation number is generated as a reply. If not, an error message is generated as a reply.
User Input: delete
event_number confirmation_number, e.g. delete 5 5111
When deleting a reservation, a valid Event Number and the Valid Confirmation Number for an existing reservation is given to the server. If both are valid, the server replies with Person's name, amount of space reserved and an "Are you sure you want to delete this reservation?" prompt. When the user answers "yes", the reservation will be deleted.
User Input: exit
The Client must have some way to stop its execution.
Note that the Agent Client does not need a persistent connection to the server. So this could be implemented to establich a connection to the server for each operation that is needed to be performed which would then terminate the connection to the server after the transaction has occurred.
The Manager Client will be able to perform all of the tasks done by the Agent Client plus:
User Input: add
description
request_space
,e.g.
add
Lincoln
Park
Concert
5000
The user will need to specify the description and the total amount of available space. The server will generate a unique Event Number for the event.
User Input: remove
event_number, e.g. remove 100
The user will need to specify a valid Event Number and must answer an "Are you sure?" prompt, before removing the event. Once removed, all information about the event will be lost.
User Input: detail
event_number, e.g. detail 100
When given a valid event, the server will respond with Event Description, number of Available spaces and for each reservation make, the person name, the confirmation number and the amount of space reserved.
When ever a client (any client) makes or deletes a reservation, an message i is to be displayed to all manager clients showing the Event Number, the amount of space reserved/made available and the total amount of space available.
This operation will require a persistent connection between the Manager Client(s) and the Server.
Note that there may be multiple Manager and Agent Clients running at any particular time. You may assume that the server use a known port number which may be hardcoded into your code. A good port number to use is the result of adding 10,000 to the last 4 digits of your UIN.
Your project is to be turned in electronically via turnin to the CS 441 instructor account using the project name of "proj1". Each student is to work independently on this project. You are also to write up a README file that discusses how to compile and run the project, the form of how the the reservation data is stored by the server and the communication protocol used between the server and the clients. Also, there will be some points for the project awarded based on programming style used in your project.
How to turn in your work
Turnin your program electronically using the "turnin" command from your CS account as follows:
turnin -c cs441 -p proj1 [your project
directory]
where the [your project directory] is the directory name under which
you have all your files related to this programming problem. The turnin
command will automatically compress the data under your directory, so
there is no need to do the compression by yourself. This also assumes
that you are in the
parent directory of the project directory when executing the command.
Notice you can only invoke turnin command on the Linux machines in the lab or after logging into the server machine oscar.cs.uic.edu.
If you want to verify that your project was turned in, look in the
turnin directory for a file with your userid. For instance for this
project, from your CS account you would type:
turnin -c cs441 -p proj1 -v
Note that you can execute turnin as many times as you would like, up until the program deadline when turnin will be disabled for this project. Each time you execute turnin for a project, you overwrite all of what you had turned in previously for that project.It does not work in an incremental way.