CS450

SUMMER 2008

PROJECT

 

DUE: JULY 21, 2008 (MIDNIGHT).

DESCRIPTION:

PRODUCE A DISTRIBUTED FILE SYSTEM THAT HAS BEEN BUILT USING JAVA’ S  RMI TECHNOLOGY.

 

NODE A (THE SERVER) PROVIDES THE FOLLOWING SERVICES :

a)       int WriteToFile(String name, String write, int id) where the returned value int=0 if the writing is successful otherwise it is a different number  indicating an error. The String name represents the name of the file. The String write is the String to be appended in the file. The string id is the id of the client node that requested the writing. When writing is done and before the service is terminated a callback to method Display on the client is made but the String item is the message “writing to file was successful” (see client’s service below). This service terminates if it receives the String “displayed”

from the client (as a result of callback) or it terminates the server if it receives the String “exception”.

b)      int ReadFile(String name, int id) where the returned value int=0 if the file was successfully opened for reading and id is the client’ s id number. This operation, however, causes a callback to a service provided by Node B ( a client) called Display and passes it the read String from the file as a callback to method Display on the client side. ReadFile terminates when the Display method (on the client side) returns the String “displayed”. If it receives “exception” as a result of the callback it terminates the server.

 

NODE B (THE CLIENT) PROVIDES THE FOLLOWING SERVICE:

            String Display(String item, int id) where item is the String to be displayed on the Client’ s console, int id is the client’s       id returned by the server this tine (the client who requested the particular file to be read) and it gets displayed also ,and     the returned String value is “displayed” when the display completes or “exception” if an exception took place during the          display or the method Display did not execute properly. You need to implement your own exception for method    Display.

 

THERE IS A REGISTRY (rmiregistry). OPERATING AT THE DEFAULT PORT FOR THE REGISTRY

THE NODE A HAS REGISTERED A REMOTE OBJECT FOR THE SERVICE UNDER THE STRING  “writereadtofile”

CLIENT NODES REGISTER THEIR CALLBACK SERVICE UNDER THE NAME “display”.

SINCE MULTIPLE INSTANCES OF THE CLIENT NODE CAN BE GENERATED EACH CLIENT NODE SHOULD HAVE A DIFFERENT ID NUMBER GENERATED AUTOMATICALLY.

 

MAKE SURE THAT YOU INCLUDE THE SOURCE CODE AS WELL AS THE COMPILED FILES.

 

1.      You can produce and test your File Server processes on your own WINDOWS environment machine. The TA will check the programs in her own WINDOWS machine (not in the UNIX server).

2.      The files are read or written are text files. You need to produce the test text files and include them in your submission.

3.      You need to produce a README file that describes:

·         How your system can be used

·         Gives the name of the test files to be used by the TA to test your write / read functionality

·         Provides a test for testing the exception part. Describe to TA how to test that aspect.