Project 1 - Distributed Objects

 

Objectives

Gain experience using:

1)      Distributed objects

2)      Naming servers

3)      User authentication

Functional Requirements

Implement an online chat system that allows users to communicate with each other through discussion groups.  Your system should consist of a client program which runs on each user’s desktop, and a centralized server through which the clients communicate.  The GUI for the client is shown below.  (The GUI code is provided, but you will need to write the code behind it to make it do something useful.)

 

 

 

The left pane displays a list of available discussion groups.  The top-right pane displays the comments that have been made in the selected discussion.  When the user selects a discussion, the comment area is updated to show the comments for the newly-selected discussion.

 

To add a new comment to the selected discussion, the user types the comment in the text box at bottom-right and clicks the Send button.  New comments immediately appear in all clients, thus allowing real-time communication between users.

 

Users must login to a chat server before they can participate in discussion groups.  When the client starts up, the user hasn’t logged in yet, so the discussion list is empty (see below).

 

 

 

The user logs in by clicking the Login button, which brings up the login dialog box.  The login dialog allows the user to enter the location of the chat server, as well as their user name and password (see below).

 

 

 

After logging in to a chat server, the user is presented with a list of available discussions on that server, from which they may select one in which they want to participate.

 

The user may create a new discussion group by clicking the Create button, and then entering the name of the new discussion (see below).  The user may delete the currently selected discussion by clicking the Delete button.  Only the original creator of a discussion group is allowed to delete it.  If a user other than the creator tries to delete a discussion group, the operation is not permitted, and an error message is displayed.  Changes made to the discussion list by either creating or deleting discussions are immediately displayed in all clients.

 

 

 

 

The user logs out from the chat server by clicking the Logout button, in which case the GUI returns to its original empty state.  The user terminates the client program by clicking the Exit button.

Implementation Requirements

This section lists some constraints on the implementation of your chat system.

 

1)      Your system should consist of a client program which runs on each user’s desktop, and a centralized server through which the distributed clients communicate.

 

2)      It must be possible to run clients and server in a distributed fashion on any computer that has JDK 1.4.2 installed.

 

3)      All communication between clients and servers must be implemented using RMI/IIOP.  Sockets, pipes, shared file systems, and other forms of inter-process communication may not be used.

 

4)      Your system must use the orbd name server to establish connectivity between clients and server.

 

5)      Your system must require users to authenticate with their Route-Y user names and passwords before participating in discussion groups.  Authentication must be performed through JNDI (this code is provided).

 

6)      Your system must correctly record the creator of each discussion group, as well as the creator and timestamp for each comment made in a discussion.

 

7)      The discussion list must display the names of the discussions in chronological order based on their creation time

 

8)      The comments within a discussion must be displayed in chronological order.

Files

The following files contain Java code provided for your use on this project:

 

auth.zip

 

This zip file contains some Java classes for performing user authentication using CS Dept. or Route-Y accounts.

 

chat.zip

 

This zip file contains the Java code for the chat client GUI.

Notes

The GUI code is provided, but you need to write all non-GUI code that actually makes the client work.  The GUI code is found in the chat.client.gui package.  You don’t need to understand the GUI code, but you do need to understand how to plug your code into the GUI, and how to invoke GUI functionality from your code.  The interface between the GUI code and your code is defined by the Client and ClientDelegate interfaces located in the chat.client package.

 

The Client interface is implemented by the GUI and defines methods that your code may call to manipulate the state of the GUI and display messages to the user.  The comments in Client.java provide further details.  The ClientDelegate interface defines methods that the GUI will use to call your code.  You must write a class that implements this interface.  The comments in ClientDelegate.java provide further details.

 

The chat.client.example package contains a sample implementation of the ClientDelegate interface and a sample main program that shows how to connect the GUI to your ClientDelegate and run it.  You should pattern your ClientDelegate implementation and your main program after this example.

 

You will be writing several implementations of the chat system during the course.  It is recommended that you use Java packages to isolate the code for each project in order to keep it organized.  For example, you might put the client code for this first project in a package named chat.client.rmi and the server code for this first project in a package named chat.server.rmi.  Using different package names for each project will help keep your code organized as time goes on.

Project Submission

Create a gzip-compressed tar file containing all of your project's source files and directories. The name of the file must have the following format:

 

firstname_lastname.tgz
 

where firstname should be replaced with your first name and lastname should be replaced with your last name. For example, if your name is Bob White, you would use the following command to create your compressed tar file:

 

$ tar czf Bob_White.tgz project-dir

 

(this assumes that your project files are stored in a subdirectory named project-dir).

After you have created your tar file, click on the following link to go to the project submission web page:

Project 1 Submission Page

After you provide your CS account login name and password and the name of your tar file, this page will upload your tar file to our server.

After submitting your tar file, in order to receive credit you must also pass off your project with a TA. When you pass off, you will be asked to download your tar file from our server to ensure that you are passing off the same code that you turned in.  The project retrieval page is located at the following link:

Project 1 Retrieval Page