Distributed Reservation Management System (DRMS) using Java RMI
In the assignments and project, you are going to implement a simple Distributed
Reservation Management System (DRMS) for libraries: a distributed system to manage a
group of library systems used by students and administrators to help them manage book
reservations. So you will need to implement both the student interface support and admin
interface support. That is, you need to implement the functionalities that will help the end
users (students and admin, in this case) make use of the reservation system to reserve
books available within the library systems.
Consider a group of libraries each associated with a unique educational institution. The
server for each library must maintain a collection of books. Each book object can be stored
in any container of your choice, but make sure the container gives the best efficiency for
the operations related to accessing the book object. The book structure should contain the
following fields:
• Name of the book
• Author of the book
• Number of copies available
Students who need to borrow a book from the library must have an account with the server
that supports the library. An account contains the following specific information about the
student:
• First Name
• Last Name
• Email Address
• Phone Number
• Unique Username (min 6 characters and max 15 characters)
• Password of at least 6 characters
• Reserved books and duration to return the books
• Fines accumulated
• Educational Institution
The accounts are placed in several lists that are stored in a hash table according to the first
character of the username indicated in the account. For example, all the accounts with the
username starting with an “A” will belong to the same list and will be stored in a hash
table (acting as the database) using the key “A”. Each server also maintains a log containing the history of all the operations that have been performed on that server. This
should be an external text file (one per server) and shall provide as much information as
possible about what operations are performed, at what time and who performed the
operation.
The system has two distinct types of users: Students and Administrators. Students can be
identified by their username, password and educational institution. Whenever a student
performs an operation, the system must identify the library that the student belongs to
based on his/her educational institution and thus direct all the operations to that specific
server. The students maintain a file (text file) of the actions they performed on the system
and the response from the system when available. For example, if you have 10 students
using your system,
you should have a folder containing 10 files. Administrators can be
identified by their username, password and educational institution. For the sake of this
assignment all the administrators have the same username which is “Admin” and the
password is also “Admin”. The administrators also maintain a file.
The operations that can be performed are the following:
Operations performed by Students
• createAccount (FirstName, LastName, EmailAddress, PhoneNumber, Username,
Password, EducationalInstitution)
When a student invokes this method through a client program called StudentClient,
the server associated with the educational institution attempts to create an account
with the information passed if the username does not exist and that the passed
information is valid according to the problem description by inserting the account at
the appropriate location in the hash table. The server returns information to the
student whether the operation was successful or not and the student file is created
and updated on the server. For simplicity it is assumed that the student has access
to creating an account in the library only if he/she is enrolled in the educational
institution.
• reserveBook (Username, Password, BookName, AuthorName)
When a student invokes this method through the client program called the
StudentClient, the server associated with this student attempts to find if the book
exist (although the book entry is found, quantity should be greater than 0 to
successfully reserve). If it does, then the corresponding quantity is decremented
and the book is updated to the reserved book list of the student. Note that the
student has to provide valid credentials to reserve a book. The duration is set to 14
days by default. Student file is updated.
Operation performed by Administrators
• getNonRetuners (AdminUsername, AdminPassword, EducationalInstitution,NumDays)
When Admin runs the getNonReturners () though the client program AdminClient,
it lists all the students’ First Name, Last Name and Phone Number who have not
returned the books with “NumDays” past their loan date in all the three educational
institutions. The admin File is updated with this information. The admin can then pass that information to the customer care agent to place a call to all the customers
to remind them about the book loan.
For the sake of this assignment, you have to make sure the getNonReturners () functions
returns
Educational Institution 1 : FirstName1 LastName1 514xxxxxxx
FirstName2 LastName2 514xxxxxxx
FirstName3 LastName3 514xxxxxxx
……..
Educational Institution 2 : FirstName1 LastName1 514xxxxxxx
FirstName2 LastName2 514xxxxxxx
FirstName3 LastName3 514xxxxxxx
……..
Educational Institution 3 : FirstName1 LastName1 514xxxxxxx
FirstName2 LastName2 514xxxxxxx
FirstName3 LastName3 514xxxxxxx
……..