This repository contains a Room Reservation Application built using Java RMI (Remote Method Invocation) technology. The project is divided into two separate components:
-
Rooms: Server-side application that manages the rooms.
-
RoomBookingClient: Client-side application that interacts with the server to book rooms.
UML Package diagram :
This project demonstrates the implementation of a distributed Room Reservation System using Java RMI technology. The server manages room availability and reservations, while clients can book, view, and manage room reservations by communicating with the server remotely.
The system is built with a 2-tier architecture to ensure that multiple users can interact with a centralized server to:
- Reserve/book a Room: Clients can book a room for a specific time slot.
- Cancel Reservations: Clients can remove existing reservations.
- Check Availability: Clients can verify room availability for specific time slots.
- Admin Features:
- View all registered rooms.
- Check available rooms for specific time slots.
The server ensures synchronization of reservations to prevent conflicts, such as two clients booking the same room at the same time.
- Java: Programming language used to implement the application logic.
- Java RMI: For enabling communication between the server and the client.
- Eclipse IDE: Development environment for building and testing the application.
- Java Development Kit (JDK) (Version 8 or later).
- Eclipse IDE (or any Java IDE).
- RMI Registry (Comes with Java SDK).
A center (facility) has several rooms that can be reserved for events. Each room has an associated schedule with available time slots. Multiple users can access the system simultaneously to:
- Check room availability.
- Reserve a room for a specific time slot.
- Cancel a reservation.
The actions must be synchronized to prevent conflicts when multiple clients attempt to book the same time slot simultaneously.
UML Component diagram :
UML Use case diagram
- The client selects a room and a time slot.
- The server checks if the time slot is still available.
- If available, the reservation is recorded in the ConcurrentHashMap.
- The method is synchronized to prevent two clients from reserving the same time slot.
- The client can cancel an existing reservation.
- The server checks if the reservation exists and then removes it from the list of reservations.
- The client sends a verification request specifying the room and time slot.
- The server returns the result of the verification:
- Available or Not Available.
- The client queries the server to view all available time slots for a specific room.
- The server returns a list of available time slots, if they exist.
- The client queries the server to check if a room is available for at least one time slot during the day.
- The server returns:
- False: If the room is reserved for all time slots for the entire day.
- True: Otherwise.
- An administrator can view the list of available rooms for a specified time slot.
- The administrator can retrieve a list of all rooms registered in the system.
-
If a client attempts to reserve a time slot that is already taken, the server returns an error message indicating the conflict.
UML Class diagram
- Concurrent Access: The system ensures synchronization to handle simultaneous access by multiple clients.
- Admin Functionality: Administrators have enhanced privileges, such as viewing all rooms and querying specific time slots.
- Error Handling: Conflicts are managed gracefully, and users are notified when a time slot is unavailable.
- Java RMI (Remote Method Invocation)
- Java SE
- Add a graphical user interface (GUI) for ease of use.
- Implement persistent storage using a database.
- Introduce notifications for reservation confirmations or conflicts.
- Mohamed Saber Mahjoub
This project is licensed under the MIT License.