资源简介

基于RMI的分布式议程服务,可以用户注册,添加会议,查询会议,删除会议,清除会议,附带bat

资源截图

代码片段和文件信息

package bupt.sse.wenfeng.Client;

import java.text.SimpleDateFormat;
import java.util.Scanner;
import java.net.MalformedURLException;
import java.rmi.*;

import bupt.sse.wenfeng.service.Interface;

public class Client 
{
private static int PORT = 1099;

public static void main(String[] args) throws Exception
{
System.out.println(“请按照一下输入执行对应操作“);
System.out.println(“输入   操作“);
System.out.println(“-r    注册“);
System.out.println(“-a  添加会议“);
System.out.println(“-q  列入会议“);
System.out.println(“-d  删除会议“);
System.out.println(“-c  清空会议“);
String input = ““;
Scanner in = new Scanner(System.in); 
while(!input.equals(“-Exit“)){
input = ““;
input = in.nextLine();
SimpleDateFormat format = new SimpleDateFormat(“yyyy-MM-dd“);
String registryURL = “rmi://localhost:“+PORT+“/Server“;
Interface service = null;
try {
service = (Interface)Naming.lookup(registryURL);
if(input.equals(“-r“))
{
if(service.register(“bupt“ “123“))
System.out.println(“register success“);
else
System.out.println(“error“);
if(service.register(“sse“ “123“))
System.out.println(“register success“);
else
System.out.println(“error“);
if(service.register(“wenfeng“ “123“))
System.out.println(“register success“);
else
System.out.println(“error“);
}
else if(input.equals(“-a“))
{
if(service.add(“bupt“ “123“ “sse“ “business“ “生意会议“ format.parse(“2015-12-11“)format.parse(“2015-12-12“)))
System.out.println(“add success“);
else
System.out.println(“error“);
if(service.add(“sse“ “123“ “wenfeng“ “technology_research“ “技术会议“ format.parse(“2015-12-22“)format.parse(“2015-12-23“)))
System.out.println(“add success“);
else
System.out.println(“error“);
if(service.add(“wenfeng“ “123“ “bupt“ “lecture“ “事务会议“ format.parse(“2015-12-15“)format.parse(“2015-12-20“)))
System.out.println(“add success“);
else
System.out.println(“error“);
}
else if(input.equals(“-q“))
{
String queryresult= new String(service.query(“bupt“format.parse(“2015-12-11“)format.parse(“2015-12-12“)));
if(queryresult.length()>1)
System.out.println(queryresult);
else
System.out.println(“error“);
queryresult= new String(service.query(“wenfeng“format.parse(“2015-12-15“)format.parse(“2015-12-20“)));
if(queryresult.length()>1)
System.out.println(queryresult);
else
System.out.println(“error“);
queryresult= new String(service.query(“sse“format.parse(“2015-12-22“)format.parse(“2015-12-23“)));
if(queryresult.length()>1)
System.out.println(queryresult);
else
System.out.println(“error“);
}
else if(input.equals(“-d“))
{
if(service.delete(“bupt“ 1))
System.out.println(“delete s

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-01-05 14:59  MeetingSystem\
     文件         301  2015-12-24 18:07  MeetingSystem\.classpath
     文件         389  2015-12-24 18:07  MeetingSystem\.project
     目录           0  2016-01-05 14:59  MeetingSystem\.settings\
     文件         598  2015-12-24 18:07  MeetingSystem\.settings\org.eclipse.jdt.core.prefs
     文件         137  2015-12-24 20:32  MeetingSystem\add.bat
     目录           0  2016-01-05 14:59  MeetingSystem\bin\
     目录           0  2016-01-05 14:59  MeetingSystem\bin\bupt\
     目录           0  2016-01-05 14:59  MeetingSystem\bin\bupt\sse\
     目录           0  2016-01-05 14:59  MeetingSystem\bin\bupt\sse\wenfeng\
     目录           0  2016-01-05 14:59  MeetingSystem\bin\bupt\sse\wenfeng\Client\
     文件        3411  2015-12-24 20:29  MeetingSystem\bin\bupt\sse\wenfeng\Client\Client.class
     文件        3727  2015-12-24 20:56  MeetingSystem\bin\bupt\sse\wenfeng\Client\ClientForBAT.class
     目录           0  2016-01-05 14:59  MeetingSystem\bin\bupt\sse\wenfeng\service\
     文件        4302  2015-12-24 20:49  MeetingSystem\bin\bupt\sse\wenfeng\service\Implement.class
     文件         614  2015-12-24 20:53  MeetingSystem\bin\bupt\sse\wenfeng\service\Interface.class
     文件        1874  2015-12-24 20:49  MeetingSystem\bin\bupt\sse\wenfeng\service\Meeting.class
     文件        1219  2015-12-24 20:49  MeetingSystem\bin\bupt\sse\wenfeng\service\Server.class
     文件         623  2015-12-24 20:49  MeetingSystem\bin\bupt\sse\wenfeng\service\User.class
     文件         137  2015-12-24 20:36  MeetingSystem\clear.bat
     文件         137  2015-12-24 20:35  MeetingSystem\delete.bat
     文件         137  2015-12-24 20:33  MeetingSystem\query.bat
     文件         137  2015-12-24 20:31  MeetingSystem\register.bat
     文件         110  2015-12-24 20:25  MeetingSystem\server.bat
     目录           0  2016-01-05 14:59  MeetingSystem\src\
     目录           0  2016-01-05 14:59  MeetingSystem\src\bupt\
     目录           0  2016-01-05 14:59  MeetingSystem\src\bupt\sse\
     目录           0  2016-01-05 14:59  MeetingSystem\src\bupt\sse\wenfeng\
     目录           0  2016-01-05 14:59  MeetingSystem\src\bupt\sse\wenfeng\Client\
     文件        3651  2015-12-24 20:17  MeetingSystem\src\bupt\sse\wenfeng\Client\Client.java
     文件        3488  2015-12-24 20:56  MeetingSystem\src\bupt\sse\wenfeng\Client\ClientForBAT.java
............此处省略35个文件信息

评论

共有 条评论