SSD08 Exercise04 个人解答

RMI Distributed Agenda Service

  • Background
  • Tasks
  • Interface
  • Submission
Readings:
  • Reilly and Reilly, Chapter 11

Background

Build a distributed shared agenda service using Java RMI. Various clients should be able to connect to the shared agenda to query, add, and delete meetings. The server should also have management functionality that allows registration and clearing meetings.

Tasks

Your agenda service should implement the following functionality. Each piece of functionality outlined below must be accessible from the client and be run by the server.

User Registration
New users may register. New users must supply a user name and a password. If the supplied user name is already in use by some other user, print an error message. Upon successful registration, print a message stating so.
Adding Meetings
Registered users may add meetings to their agenda. Meetings must be called between two registered users. A user may not create a meeting without another user. Parameters should include the start and end times, a label, and the name of the user with whom the meeting is held. When a meeting is added, it must appear in the agenda of the user who added it as well as in the agenda of the user with whom the meeting is held. A user may not double book another user — if a user already has a meeting that overlaps with a new meeting, an error should be raised, and no meeting should be added to the agenda. The user should receive a message indicating a successful addition or an error if one occurs.
Querying Meetings
Registered users may look up all meetings in their agenda in a given interval of time. The parameters should include the start and end times of the search interval. Return a list of the entries found in the specified time range. In the list, include the start time, end time, label, and the name of the user with whom the meeting is held. You should include meetings that the user has called as well as meetings for which the user has been registered.
Deleting Meetings
Registered users may delete entries that they have created. The parameters should uniquely identify the entry to be deleted as well as the user who is performing the deletion.
 
Clearing Meetings
Registered users may clear all meetings they have called.

Interface

Write a command-line client that accesses your agenda server. The client must be accessible from command line parameters and via a menu. To access the client via a menu, it must be run as java [clientname] [servername] [portnumer] where [clientname] is the name of your client program, [servername] is the name of the machine where the server is running, and [portnumer] is the port on which the rmiregistry service is running. It is up to you to design an appropriate menu driven interface. To access the above functionality from the command line, assume that the following parameters must be provided to the client.

java [clientname] [servername] [portnumber] register [username] [password]
Where [clientname] is the name of your client program, [servername] is the name of the machine where the server is running, [portnumber] is the port on which rmiregistry is running, [username] is the log in name chosen by the user, and [password] is the user's chosen password.


java [clientname] [servername] [portnumber] add [username] [password] [otherusername] [start] [end] [title]
Where [clientname] is the name of your client program, [servername] is the name of the machine where the server is running, [portnumber] is the port on which rmiregistry is running, [username] is the log in name chosen by the user, [password] is the user's chosen password, [otherusername] is the name of the user who the meeting is scheduled with, [start] is the start time of the meeting, [end] is the end time of the meeting, and [title] is the meeting's title.


java [clientname] [servername] [portnumber] query [username] [password] [start] [end]
Where [clientname] is the name of your client program, [servername] is the name of the machine where the server is running, [portnumber] is the port on which rmiregistry is running, [username] is the log in name chosen by the user, [password] is the user's chosen password, [start] and [end] represent the time interval of interest.


java [clientname] [servername] [portnumber] delete [username] [password] [meetingid]
Where [clientname] is the name of your client program, [servername] is the name of the machine where the server is running, [portnumber] is the port on which rmiregistry is running, [username] is the log in name chosen by the user, [password] is the user's chosen password, and [meetingid] is the identifier of the meeting to be deleted from the agenda.


java [clientname] [servername] [portnumber] clear [username] [password]
Where [clientname] is the name of your client program, [servername] is the name of the machine where the server is running, [portnumber] is the port on which rmiregistry is running, [username] is the log in name chosen by the user, and [password] is the user's chosen password. The given user's agenda must be cleared with this command.

Submission

Coding Style and Documentation

You are expected to design classes in an object-oriented manner using good programming practices.

Your code must be written using Java coding conventions . Your code must be well documented and contain a README file with instructions on compiling and running each program.

 

The files you should turn in are listed below.

  • All files necessary to run your agenda service
  • A README file

To help yourself do your best on this assessment, consult this general list of grading guidelines.

你可能感兴趣的:(Blog,Access,UP)