commented some

git-svn-id: svn://anubis/gvsu@293 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
josh 2008-11-29 18:35:04 +00:00
parent eb5cd4b1cb
commit c59e7f917b
6 changed files with 57 additions and 19 deletions

View File

@ -15,6 +15,9 @@ import java.net.*;
import edu.gvsu.cis.cs656.lab4.server.PresenceService;
import edu.gvsu.cis.cs656.lab4.server.RegistrationInfo;
/**
* ChatClient implements the main client class for our chat system.
*/
public class ChatClient
{
private PresenceService myPServ;
@ -378,13 +381,16 @@ public class ChatClient
}
}
/* Create a presence service with the given host and port */
PresenceService pServ = new PresenceServiceImpl(host, port);
ChatClient chatClient = new ChatClient(pServ, user);
chatClient.run();
}
/**
* Print basic usage information.
*/
private static void usage()
{
System.err.println("Usage: ChatClient <user> [host[:port]]");

View File

@ -1,4 +1,10 @@
/* Josh Holtrop
* 2008-12-04
* CS656
* Lab 4
*/
import java.io.File;
import org.restlet.Application;
@ -14,6 +20,9 @@ import com.db4o.Db4o;
import com.db4o.ObjectContainer;
import com.db4o.config.Configuration;
/**
* This class implements the main functionality of the server for our chat program.
*/
public class ChatServer extends Application
{
/**
@ -74,7 +83,5 @@ public class ChatServer extends Application
System.out.println("Whoops, our server threw an exception while bootstrapping, details follow.");
ex.printStackTrace();
}
}
}

View File

@ -1,4 +1,10 @@
/* Josh Holtrop
* 2008-12-04
* CS656
* Lab 4
*/
import java.io.IOException;
import java.util.*;

View File

@ -1,4 +1,10 @@
/* Josh Holtrop
* 2008-12-04
* CS656
* Lab 4
*/
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@ -12,6 +18,12 @@ import com.db4o.query.Predicate;
import edu.gvsu.cis.cs656.lab4.server.RegistrationInfo;
/**
* This class holds basic user information to be stored in the server's database.
*
* It extends RegistrationInfo so that the methods it provides are easily
* available. It then adds methods specific for the REST framework.
*/
public class User extends RegistrationInfo
{
public DomRepresentation getDomRepresentation() throws IOException

View File

@ -1,11 +1,9 @@
//----------------------------------------------------------------------
//
// Filename: UserResource.java
// Description:
//
// $Id:$
//
//----------------------------------------------------------------------
/* Josh Holtrop
* 2008-12-04
* CS656
* Lab 4
*/
import java.io.IOException;
import java.util.*;
@ -25,10 +23,16 @@ import org.w3c.dom.*;
import com.db4o.ObjectContainer;
import com.db4o.query.Predicate;
/**
* This is a Resource class for handling a single User object.
*
* You can GET a representation of the user, PUT to modify it, or DELETE it.
*/
public class UserResource extends Resource
{
private User myUser;
/* Construct the resource and initialize myUser */
public UserResource(Context context, Request request, Response response)
{
super(context, request, response);

View File

@ -1,11 +1,9 @@
//----------------------------------------------------------------------
//
// Filename: UsersResource.java
// Description:
//
// $Id:$
//
//----------------------------------------------------------------------
/* Josh Holtrop
* 2008-12-04
* CS656
* Lab 4
*/
import java.io.IOException;
import java.util.*;
@ -25,6 +23,11 @@ import org.w3c.dom.*;
import com.db4o.ObjectContainer;
import com.db4o.query.Predicate;
/**
* This is a Resource class for handling users.
*
* You can GET a list of all users, or POST to create a new one.
*/
public class UsersResource extends Resource
{
public UsersResource(Context context, Request request, Response response)