In this assignment, you are to modify and augment your solution to the previous assignment to create a distributed messaging application using Java Remote Method Invocation (RMI). The two overall objective for this assignment are: (1) working with client-server communication in RMI, and deploying your RMI server to Raspberry Pi.

The Message client is able to send and receive messages from other instances of the Message client (remote or local) through the RMI server.

The Message server is a java RMI UnicastRemoteObject, which implements a Remote Interface which you should create based on the MessageLibrary methods defined in the previous assignment. When the server's administration Java program is started, it makes a registration in the RMI Registry for this application with the program author's assurite id as the key, For example, the instructor's would register the RMI URL:

rmi://localhost/lindquis

As in the prior assignment, the client should be used on instructor's view, as shown below: see image.

Your message Client should take command line arguments, as shown in the Ant build commands below. The hostname and port specify the machine and port that are running the Rmi Registry. Your server will be running on the same machine (RPi). The user name specifies client's user for purposes of sending an receiving messages. This user name will be used in composing (from) and getting (to) messages. In grading your program, the server will be started, and then two clients will be executed with different user names, to test whether the client connects to the server correctly, and whether messages can be sent from one client to the other through the server.

The fields on the right side of the client view are used to both display received messages, and to compose new messages. The Message menu items or buttons may be used to send a message. The Message menu has the following items:

  • Delete - Removes the message that is currently selected in the message list from the list and from the server.
  • Reply - Switches the right panel fields from display to compose. Swaps the to and from fields, pre-pends Re: to the Subject field and modifies the message content pane to allow new text to be entered before the old message.
  • Send Text - Uses the appropriate remote method to send a clear text message to the Secure Message application indicated by the To field.
  • Send Cipher - You do not need to implement this feature in this assignment.
  • Get Mail. The File menu Get Mail selection should cause your Message Client to contact the serve to see whether the current user has any new messages available. If so, the client's message list should be modified with new message headers.

All client source code should be packaged as: ser321.assign3.myasuriteid.client. All server source should be packaged as: ser321.assign3.myasuriteid.server.

Your java files/classes should contain comments as described in the previous assignment.

The Ant directive file build.xml. The build should contain targets for targets, clean, prepare, compile, server, and client. Use the Employee example's build.xml file as the basis for constructing your solution's build support. Your build.xml should support starting the client and server as follows:

ant server -DhostId=localhost -DregPort=1099
ant client -DhostId=localhost -DregPort=1099 -Duser Id=Tim.Lindquist
ant client -DhostId=localhost -DregPort=1099 -DuserId=Jimmy.Buffett
For running on your raspberry pi, the hostId's in each of the above would be replaced with the RPi's hostname/IP. The clients would be run on Linux Debian Virtual Box, and the server would be run on the RPi.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.