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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值