Java Chat Rooms
1. Required Features (20 pts in total)
You are expected to implement a chat room using Java.
This project requires you to execute
multiple threads
and display multiple command-line interfaces, namely chat rooms.
Each chat room command-line interface should be able to send messages to all other command-line interfaces while receiving and displaying messages on the command-line interface.
The project should support the following features:
-
Multithreading Implementation (5 pts).
- Your program should be implemented based on Java multithreading techniques.
- Hence, your project should be able to display multiple command-line interfaces (i.e., chat rooms) concurrently in a single computer/workstation.
- Closing or starting a command-line interface should not affect the proper functioning of other command-line interfaces.
-
Chat Room Functions (5 pts)
- When creating a new chat room command-line interface, the system will automatically assign this user an ID of 5 digits (e.g., 01234). In the meantime, the user is able to input a username via keyboard input. Both the ID and the username should be displayed before each message the user sends.
- The user is able to send messages via keyboard input and view the messages of other users (which are sent by other command-line interfaces).
- The graphical user interface is NOT required since this is the first project for CSC1004.
- Message Display (5 pts):
- Your program can display the names and the ids of other users when a new user enters the chat room (only shown to the new user).
- Your program can display the name and ID of the user when he or her is leaving the chat room (shown to all users in the chatroom).
- You program can display the current time when a user sends or receives a message (shown to all users in the chatroom).
- Chat Record Storage (5 pts):
- The user can save all the chat records to a local file so that a user can view all messages even when entering the chat room.
- The messages should be stored on the server side. The server should deliver these messages to a client when he or she enters the chatroom.
2. Submission
Submission should be made at the blackboard system. You need to submit:
- Video: Prepare a presentation for your project by recording a video. Ensure the video captures your screen to demonstrate how the code runs on your laptop or desktop.
- Code: Prepare your code for submission. The main functions and classes in the code must have comments in a reader-friendly format.
3. Resources