5.6 KiB
Problem Description
You are required to implement an Internet based College Course application system for the University using Java RMI. The server allows a client to login and retrieve an ApplicationForm object that will then be completed on the client side. The client can then submit the completed ApplicationForm object back to the server for validation and processing. The design of the system makes it possible for new ApplicationForm implementation classes to be easily added to the server in the future, making the system very flexible.
Implementation Details
The answer should include full source code for the following Java interfaces and classes:
- ApplicationHandler.java - this Java interface provides remote methods for user login, based on a username and password, downloading an Application Form and submitting a completed Application Form. If sucessful, the login method returns a long integer value that must be passed to the other two server methods as a session identifier. The methods to download and upload an Application Form object should use the interface type ApplicationForm as described next. Provide suitable exception handling for the remote methods to catch possible issues with parameters or method invocation e.g. InvalidCredentials, InvalidSessionID etc.
- ApplicationForm.java - this Java interface provides methods for retrieving and answering questions. The interface should have a method to retrieve general information about the application form and a method to return the total number of questions to be answered. It should also have methods to retrieve and answer questions, based on the question number, it only needs to support text type questions and answers.
- ApplicationFormV1.java - this Java class should provide an implementation of the ApplicationForm interface. It should include questions that allow the following information about the applicant to be included in a completed application form: name, address, email and contact number of the applicant. It should also have a question that allows an applicant to provide a personal statement e.g. this could be used to include additional details about the applicant and a summary of their existing qualifications or results.
- ApplicationHandlerImpl.java - this Java class should provide the implementation of the ApplicationHandler interface, an instance of this class will be created by the mainline server code. A single valid username and password can be hardcoded into the server for the purposes of implementing the login method. The implementation method to download an ApplicationForm therefore just needs to return an instance of the ApplicationFormV1 class. The CourseServer implementation method to upload a completed ApplicationForm should just save the completed form, in a suitable text format, to a file. For this purpose, the implementation class can include an appropriate toString() method. The filename used should be based on the first name and second name provided in the ApplicationForm.
- ApplicationServer.java - this Java class should provide the mainline server code. This should create an instance of the ApplicationHandlerImpl class and then register this with the RMIRegistry so that it can be located and used by the client code.
- ApplicationClient.java - this Java class should provide the client code. This can done as a simple command line client program that will interact with the server as follows: (i) Login to the server. (ii) Download an ApplicationForm object. (iii) Call methods on the ApplicationForm, as required to complete the form. (iv) Submit the completed Application Form back to the sever. Completing the Assignment
There are two main programming tasks. The first is to complete the implementation of the remote methods in the ApplicationHandlerImpl class, the second is to write the client program that can use and interact with the server i.e. it logs into the server to get an access token, it then downloads an ApplicationForm object, completes the form and then finally submits the ApplicationForm object back to the server. For the purposes of completing this assignment you can create just one ApplicationFormV1 object for testing purposes. Also, the server only needs to implement the remote interfaces provided i.e. there is no need to do any further processing on a completed ApplicationForm after it has been uploaded to the server other than to save a copy of the submission as a text file on the server. You do not need to implement a GUI or any interactive features for the client program, it can be done as a simple command line program that calls methods on the server and on an ApplicationForm object after it has been downloaded to the client. You should include some debug related print commands in both the client and server programs for testing and verification purposes.
Submission Details
When completed you should submit copies of the source code you have written for the assignment as well as a document describing how you tested the application, the document should include screen shots showing evidence of the application running and the testing that was carried out. Please combine all the source code files and the related document (PDF or MS Word format only) into a single ZIP file for submission. All submissions should be done via Canvas and if you submit more than one attempt then only the final attempt will be marked. You can work on this assignment individually or in groups of no more than two students. In the case of a group submission only one member of the group needs to submit the assignment on Canvas, but please ensure that the ID number for both students is clearly indicated in the submission.