From c59e7f917bcf336a59ff5018078f3c775dd6b753 Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 29 Nov 2008 18:35:04 +0000 Subject: [PATCH] commented some git-svn-id: svn://anubis/gvsu@293 45c1a28c-8058-47b2-ae61-ca45b979098e --- cs656/lab4/ChatClient.java | 8 +++++++- cs656/lab4/ChatServer.java | 11 +++++++++-- cs656/lab4/PresenceServiceImpl.java | 6 ++++++ cs656/lab4/User.java | 12 ++++++++++++ cs656/lab4/UserResource.java | 20 ++++++++++++-------- cs656/lab4/UsersResource.java | 19 +++++++++++-------- 6 files changed, 57 insertions(+), 19 deletions(-) diff --git a/cs656/lab4/ChatClient.java b/cs656/lab4/ChatClient.java index a025da2..b43983b 100644 --- a/cs656/lab4/ChatClient.java +++ b/cs656/lab4/ChatClient.java @@ -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 [host[:port]]"); diff --git a/cs656/lab4/ChatServer.java b/cs656/lab4/ChatServer.java index f94512a..ebc22ac 100644 --- a/cs656/lab4/ChatServer.java +++ b/cs656/lab4/ChatServer.java @@ -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(); } - } - } diff --git a/cs656/lab4/PresenceServiceImpl.java b/cs656/lab4/PresenceServiceImpl.java index d033248..a1c2c31 100644 --- a/cs656/lab4/PresenceServiceImpl.java +++ b/cs656/lab4/PresenceServiceImpl.java @@ -1,4 +1,10 @@ +/* Josh Holtrop + * 2008-12-04 + * CS656 + * Lab 4 + */ + import java.io.IOException; import java.util.*; diff --git a/cs656/lab4/User.java b/cs656/lab4/User.java index 69c8838..dc30d37 100644 --- a/cs656/lab4/User.java +++ b/cs656/lab4/User.java @@ -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 diff --git a/cs656/lab4/UserResource.java b/cs656/lab4/UserResource.java index b42e2a5..71cb02d 100644 --- a/cs656/lab4/UserResource.java +++ b/cs656/lab4/UserResource.java @@ -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); diff --git a/cs656/lab4/UsersResource.java b/cs656/lab4/UsersResource.java index da2b69b..6be1d89 100644 --- a/cs656/lab4/UsersResource.java +++ b/cs656/lab4/UsersResource.java @@ -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)