diff --git a/docs/Client/SmallTalkClient.html b/docs/Client/SmallTalkClient.html
new file mode 100644
index 0000000..dd24558
--- /dev/null
+++ b/docs/Client/SmallTalkClient.html
@@ -0,0 +1,397 @@
+
+
+
+
+
+ SmallTalkClient
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+ Prev Class
+ Next Class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ java.lang.Object
+
+
+ Client.SmallTalkClient
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Summary
+
+ Constructors
+
+ Constructor and
+ Description
+
+
+
+ SmallTalkClient ()
+
+ Constructor for starting
+ server
+ Opens the socket at hostName and starts
+ the server
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+ Methods
+
+
+ Modifier and
+ Type
+
+ Method and
+ Description
+
+
+
+ static void
+
+ main (java.lang.String[] args)
+
+
+
+ static void
+
+ openLoginWindow ()
+
+
+
+ void
+ run ()
+
+ (non-Javadoc)
+
+
+
+ void
+ start ()
+
+ Method that starts the
+ thread and makes a new client.
+
+
+
+
+ void
+ stop ()
+
+ Method that stops the
+ thread and server
+
+
+
+
+
+
+
+
+
+ Methods inherited from class java.lang.Object
+ clone, equals, finalize, getClass,
+ hashCode, notify, notifyAll, toString, wait,
+ wait, wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ run
+ public void run()
+ (non-Javadoc)
+
+ Specified by:
+ run in interface java.lang.Runnable
+
+ See Also:
+
+ Runnable.run()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Prev Class
+ Next Class
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Client/package-frame.html b/docs/Client/package-frame.html
new file mode 100644
index 0000000..eccf4ef
--- /dev/null
+++ b/docs/Client/package-frame.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ Client
+
+
+
+
+
+
+
+
+
diff --git a/docs/Client/package-summary.html b/docs/Client/package-summary.html
new file mode 100644
index 0000000..9f12155
--- /dev/null
+++ b/docs/Client/package-summary.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+ Client
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Client/package-tree.html b/docs/Client/package-tree.html
new file mode 100644
index 0000000..c018b10
--- /dev/null
+++ b/docs/Client/package-tree.html
@@ -0,0 +1,136 @@
+
+
+
+
+
+ Client Class Hierarchy
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Common/MessageReceiver.html b/docs/Common/MessageReceiver.html
new file mode 100644
index 0000000..3adde13
--- /dev/null
+++ b/docs/Common/MessageReceiver.html
@@ -0,0 +1,252 @@
+
+
+
+
+
+ MessageReceiver
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Detail:
+ Field |
+ Constr |
+ Method
+
+
+
+
+
+
+
+
+
+
+ java.lang.Object
+
+
+ Common.MessageReceiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Summary
+
+ Constructors
+
+ Constructor and
+ Description
+
+
+
+ MessageReceiver ()
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+
+
+
+ Methods inherited from class java.lang.Object
+ clone, equals, finalize, getClass,
+ hashCode, notify, notifyAll, toString, wait,
+ wait, wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Detail
+
+
+
+
+
+ MessageReceiver
+ public MessageReceiver()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Detail:
+ Field |
+ Constr |
+ Method
+
+
+
+
+
+
+
+
diff --git a/docs/Common/MessageSender.html b/docs/Common/MessageSender.html
new file mode 100644
index 0000000..1445669
--- /dev/null
+++ b/docs/Common/MessageSender.html
@@ -0,0 +1,258 @@
+
+
+
+
+
+ MessageSender
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Detail:
+ Field |
+ Constr |
+ Method
+
+
+
+
+
+
+
+
+
+
+ java.lang.Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Summary
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+
+
+
+
+ Methods inherited from class java.lang.Object
+ clone, equals, finalize, getClass,
+ hashCode, notify, notifyAll, toString, wait,
+ wait, wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Detail:
+ Field |
+ Constr |
+ Method
+
+
+
+
+
+
+
+
diff --git a/docs/Common/package-frame.html b/docs/Common/package-frame.html
new file mode 100644
index 0000000..b419560
--- /dev/null
+++ b/docs/Common/package-frame.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+ Common
+
+
+
+
+
+
+
+
+
diff --git a/docs/Common/package-summary.html b/docs/Common/package-summary.html
new file mode 100644
index 0000000..e15fe21
--- /dev/null
+++ b/docs/Common/package-summary.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+ Common
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Common/package-tree.html b/docs/Common/package-tree.html
new file mode 100644
index 0000000..90630b3
--- /dev/null
+++ b/docs/Common/package-tree.html
@@ -0,0 +1,138 @@
+
+
+
+
+
+ Common Class Hierarchy
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Server/Account.html b/docs/Server/Account.html
new file mode 100644
index 0000000..6d1d2bc
--- /dev/null
+++ b/docs/Server/Account.html
@@ -0,0 +1,505 @@
+
+
+
+
+
+ Account
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+ java.lang.Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Summary
+
+ Constructors
+
+
+ Constructor and
+ Description
+
+
+
+ Account ()
+
+ Creates an Account object.
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+ Methods
+
+ Modifier and Type
+
+ Method and
+ Description
+
+
+
+ void
+ createUserAccount (java.lang.String username,
+ java.lang.String password,
+ java.lang.String email)
+
+ Used to create a new
+ SmallTalk account.
+
+
+
+
+ boolean
+ doesAccountExist (java.lang.String email)
+
+
+
+ void
+ fetchAccountInfo (java.lang.String email)
+
+ Used to populate the password
+ and identity field for Account objects.
+
+
+
+
+ java.lang.String
+
+ getPassword ()
+
+ Used to send password
+ information to other classes
+
+
+
+
+ java.lang.String
+
+ hashPassword (java.lang.String pass)
+
+ Used to encrypt account
+ information
+
+
+
+
+ boolean
+ isUsernameTaken (java.lang.String username)
+
+ Used to see if a username is
+ taken.
+
+
+
+
+ java.lang.String
+
+ toString ()
+
+ Used to output account
+ information to a string.
+
+
+
+
+
+
+
+
+
+ Methods inherited from class java.lang.Object
+ clone, equals, finalize, getClass, hashCode,
+ notify, notifyAll, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+ createUserAccount
+public void createUserAccount(java.lang.String username,
+ java.lang.String password,
+ java.lang.String email)
+ Used to create a new SmallTalk
+ account.
+ Parameters will be passed in from client.
+ Identifies username, password and user identity.
+ Afterwards, the account information is written
+ to the accounts file.
+
+
+ Parameters:
+ username - The username of the
+ account.
+
+ password - The password of the
+ account.
+
+ email - The email of the
+ account.
+
+
+
+
+
+
+
+
+
+ fetchAccountInfo
+ public void fetchAccountInfo(java.lang.String email)
+ Used to populate the password and
+ identity field for Account objects.
+ If the username exists in the accounts file,
+ then this method fetches
+ the password and identity.
+ If the username does not exist in the accounts
+ file, the password
+ and the identity are left as null.
+ This allows for the creation of new accounts.
+
+
+ Parameters:
+ email - The email to be used.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isUsernameTaken
+ public boolean isUsernameTaken(java.lang.String username)
+ Used to see if a username is
+ taken.
+ As of now this is not used locally. Client will
+ use this later on
+ in order to see if a username is free for use.
+ Checks if password field is null, if so then the
+ user account is not
+ already in the accounts file.
+
+
+ Parameters:
+ username - The username to be
+ used.
+
+ Returns:
+ A boolean value of True if the username is
+ taken.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Server/AccountHandler.html b/docs/Server/AccountHandler.html
new file mode 100644
index 0000000..9558090
--- /dev/null
+++ b/docs/Server/AccountHandler.html
@@ -0,0 +1,477 @@
+
+
+
+
+
+ AccountHandler
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+ java.lang.Object
+
+
+ Server.AccountHandler
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+ Fields
+
+ Modifier and Type
+
+ Field and
+ Description
+
+
+
+ Account
+
+ loginAccount
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Summary
+
+ Constructors
+
+
+ Constructor and
+ Description
+
+
+
+ AccountHandler ()
+
+ Constructor for the
+ account.
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+ Methods
+
+ Modifier and Type
+
+ Method and
+ Description
+
+
+
+ boolean
+ attemptLogin (java.lang.String password)
+
+ Attempt to login using the
+ supplied password.
+
+
+
+
+ boolean
+ createAccountHandler (java.lang.String username,
+ java.lang.String password,
+ java.lang.String email)
+
+ Creates an account.
+
+
+
+ Account
+
+ forgotAccountHandler (java.lang.String email)
+
+ Handles password recovery.
+
+
+
+
+ boolean
+ loginAccountHandler (java.lang.String username,
+ java.lang.String password)
+
+ Handles logging in for the
+ account.
+
+
+
+
+
+
+
+
+
+ Methods inherited from class java.lang.Object
+ clone, equals, finalize, getClass, hashCode,
+ notify, notifyAll, toString, wait, wait,
+ wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Field Detail
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+ loginAccountHandler
+public boolean loginAccountHandler(java.lang.String username,
+ java.lang.String password)
+ throws java.security.NoSuchAlgorithmException
+ Handles logging in for the
+ account.
+
+
+ Parameters:
+ username - The username of the
+ account
+
+ password - The password of the
+ account
+
+ Returns:
+ A boolean value of true if account exists.
+
+ Throws:
+
+ java.security.NoSuchAlgorithmException
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Server/ClientThread.html b/docs/Server/ClientThread.html
new file mode 100644
index 0000000..e231263
--- /dev/null
+++ b/docs/Server/ClientThread.html
@@ -0,0 +1,443 @@
+
+
+
+
+
+ ClientThread
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+ java.lang.Object
+
+
+ java.lang.Thread
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Nested Class Summary
+
+
+
+
+
+ Nested classes/interfaces inherited from class java.lang.Thread
+ java.lang.Thread.State,
+ java.lang.Thread.UncaughtExceptionHandler
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+
+
+
+ Fields inherited from class java.lang.Thread
+ MAX_PRIORITY, MIN_PRIORITY,
+ NORM_PRIORITY
+
+
+
+
+
+
+
+
+
+ Constructor Summary
+
+ Constructors
+
+
+ Constructor and
+ Description
+
+
+
+ ClientThread (SmallTalkClient client,
+ java.net.Socket socket)
+
+ Constructor for
+ ClientThread
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+ Methods
+
+ Modifier and Type
+
+ Method and
+ Description
+
+
+
+ void
+ close ()
+
+ Closes the stream
+
+
+
+ void
+ open ()
+
+ Opens the stream in to
+ receive information from the socket
+
+
+
+
+ void
+ run ()
+
+ Runs in the current thread.
+
+
+
+
+
+
+
+
+
+ Methods inherited from class java.lang.Thread
+ activeCount, checkAccess, clone,
+ countStackFrames, currentThread, destroy,
+ dumpStack, enumerate, getAllStackTraces,
+ getContextClassLoader,
+ getDefaultUncaughtExceptionHandler, getId,
+ getName, getPriority, getStackTrace, getState,
+ getThreadGroup, getUncaughtExceptionHandler,
+ holdsLock, interrupt, interrupted, isAlive,
+ isDaemon, isInterrupted, join, join, join,
+ resume, setContextClassLoader, setDaemon,
+ setDefaultUncaughtExceptionHandler, setName,
+ setPriority, setUncaughtExceptionHandler, sleep,
+ sleep, start, stop, stop, suspend, toString,
+ yield
+
+
+
+
+
+
+ Methods inherited from class java.lang.Object
+ equals, finalize, getClass, hashCode, notify,
+ notifyAll, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+
+
+
+ close
+ public void close()
+ Closes the stream
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Server/SmallChatServer.html b/docs/Server/SmallChatServer.html
new file mode 100644
index 0000000..e998621
--- /dev/null
+++ b/docs/Server/SmallChatServer.html
@@ -0,0 +1,375 @@
+
+
+
+
+
+ SmallChatServer
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+ java.lang.Object
+
+
+ Server.SmallChatServer
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Summary
+
+ Constructors
+
+ Constructor and
+ Description
+
+
+
+ SmallChatServer (int port)
+
+ Constructor for
+ SmallChatServer.
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+ Methods
+
+
+ Modifier and
+ Type
+
+ Method and
+ Description
+
+
+
+ void
+ addThread (java.net.Socket socket)
+
+ Adds a new client when
+ needed.
+
+
+
+
+ void
+ run ()
+
+ Runs the Chat server
+
+
+
+
+ void
+ stop ()
+
+ Method that stops the
+ thread
+
+
+
+
+
+
+
+
+
+ Methods inherited from class java.lang.Object
+ clone, equals, finalize, getClass,
+ hashCode, notify, notifyAll, toString, wait,
+ wait, wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+
+
+
+
+ run
+ public void run()
+ Runs the Chat server
+
+ Specified by:
+ run in interface java.lang.Runnable
+
+ See Also:
+
+ Runnable.run()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Server/SmallTalkServer.html b/docs/Server/SmallTalkServer.html
new file mode 100644
index 0000000..0155525
--- /dev/null
+++ b/docs/Server/SmallTalkServer.html
@@ -0,0 +1,476 @@
+
+
+
+
+
+ SmallTalkServer
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+ java.lang.Object
+
+
+ java.lang.Thread
+
+
+ Server.SmallTalkServer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Nested Class Summary
+
+
+
+
+
+ Nested classes/interfaces inherited from class java.lang.Thread
+ java.lang.Thread.State,
+ java.lang.Thread.UncaughtExceptionHandler
+
+
+
+
+
+
+
+
+
+
+ Field Summary
+
+
+
+
+
+ Fields inherited from class java.lang.Thread
+ MAX_PRIORITY, MIN_PRIORITY,
+ NORM_PRIORITY
+
+
+
+
+
+
+
+
+
+ Constructor Summary
+
+ Constructors
+
+
+ Constructor and
+ Description
+
+
+
+ SmallTalkServer (SmallChatServer server,
+ java.net.Socket socket)
+
+ Constructor for
+ smalltalkServer
+ Creates server
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Summary
+
+ Methods
+
+ Modifier and Type
+
+ Method and
+ Description
+
+
+
+ void
+ close ()
+
+ Method for closing the
+ socket, streamIn, and streamOut
+
+
+
+
+ void
+ open ()
+
+ Method for opening a new
+ stream in
+
+
+
+
+ void
+ run ()
+
+ Begins the server.
+
+
+
+ void
+ send (java.lang.String msg)
+
+ Sends a message
+ Temporary method...must integrate with the
+ Common package
+
+
+
+
+
+
+
+
+
+ Methods inherited from class java.lang.Thread
+ activeCount, checkAccess, clone,
+ countStackFrames, currentThread, destroy,
+ dumpStack, enumerate, getAllStackTraces,
+ getContextClassLoader,
+ getDefaultUncaughtExceptionHandler, getId,
+ getName, getPriority, getStackTrace, getState,
+ getThreadGroup, getUncaughtExceptionHandler,
+ holdsLock, interrupt, interrupted, isAlive,
+ isDaemon, isInterrupted, join, join, join,
+ resume, setContextClassLoader, setDaemon,
+ setDefaultUncaughtExceptionHandler, setName,
+ setPriority, setUncaughtExceptionHandler, sleep,
+ sleep, start, stop, stop, suspend, toString,
+ yield
+
+
+
+
+
+
+ Methods inherited from class java.lang.Object
+ equals, finalize, getClass, hashCode, notify,
+ notifyAll, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor Detail
+
+
+
+
+
+ SmallTalkServer
+public SmallTalkServer(SmallChatServer server,
+ java.net.Socket socket)
+ Constructor for smalltalkServer
+ Creates server
+
+
+ Parameters:
+ server - The server object to
+ supply to the constructor
+
+ socket - The socket which to
+ open the server
+
+
+
+
+
+
+
+
+
+
+
+
+ Method Detail
+
+
+
+
+
+ run
+ public void run()
+ Begins the server.
+
+ Specified by:
+ run in
+ interface java.lang.Runnable
+
+ Overrides:
+ run in class java.lang.Thread
+
+ See Also:
+ Thread.run()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ close
+public void close()
+ throws java.io.IOException
+ Method for closing the socket,
+ streamIn, and streamOut
+
+
+ Throws:
+ java.io.IOException
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Server/package-frame.html b/docs/Server/package-frame.html
new file mode 100644
index 0000000..08d4f67
--- /dev/null
+++ b/docs/Server/package-frame.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+ Server
+
+
+
+
+
+
+
+
+
diff --git a/docs/Server/package-summary.html b/docs/Server/package-summary.html
new file mode 100644
index 0000000..9406a0e
--- /dev/null
+++ b/docs/Server/package-summary.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+ Server
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/Server/package-tree.html b/docs/Server/package-tree.html
new file mode 100644
index 0000000..cbdcf61
--- /dev/null
+++ b/docs/Server/package-tree.html
@@ -0,0 +1,155 @@
+
+
+
+
+
+ Server Class Hierarchy
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/allclasses-frame.html b/docs/allclasses-frame.html
new file mode 100644
index 0000000..b7c8fbc
--- /dev/null
+++ b/docs/allclasses-frame.html
@@ -0,0 +1,35 @@
+
+
+
+
+
+ All Classes
+
+
+
+
+All Classes
+
+
+
+
diff --git a/docs/allclasses-noframe.html b/docs/allclasses-noframe.html
new file mode 100644
index 0000000..a64bba1
--- /dev/null
+++ b/docs/allclasses-noframe.html
@@ -0,0 +1,35 @@
+
+
+
+
+
+ All Classes
+
+
+
+
+All Classes
+
+
+
+
diff --git a/docs/constant-values.html b/docs/constant-values.html
new file mode 100644
index 0000000..084e927
--- /dev/null
+++ b/docs/constant-values.html
@@ -0,0 +1,119 @@
+
+
+
+
+
+ Constant Field Values
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/deprecated-list.html b/docs/deprecated-list.html
new file mode 100644
index 0000000..1c301a9
--- /dev/null
+++ b/docs/deprecated-list.html
@@ -0,0 +1,119 @@
+
+
+
+
+
+ Deprecated List
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/help-doc.html b/docs/help-doc.html
new file mode 100644
index 0000000..68b238a
--- /dev/null
+++ b/docs/help-doc.html
@@ -0,0 +1,275 @@
+
+
+
+
+
+ API Help
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+ Overview
+
+ The Overview page is the
+ front page of this API document and provides a list of all
+ packages with a summary for each. This page can also contain an
+ overall description of the set of packages.
+
+
+ Package
+
+ Each package has a page that contains a list of its classes and
+ interfaces, with a summary for each. This page can contain six
+ categories:
+
+ Interfaces (italic)
+ Classes
+ Enums
+ Exceptions
+ Errors
+ Annotation Types
+
+
+
+ Class/Interface
+
+ Each class, interface, nested class and nested interface has its
+ own separate page. Each of these pages has three sections
+ consisting of a class/interface description, summary tables, and
+ detailed member descriptions:
+
+ Class inheritance diagram
+ Direct Subclasses
+ All Known Subinterfaces
+ All Known Implementing Classes
+ Class/interface declaration
+ Class/interface description
+
+
+ Nested Class Summary
+ Field Summary
+ Constructor Summary
+ Method Summary
+
+
+ Field Detail
+ Constructor Detail
+ Method Detail
+
+ Each summary entry contains the first sentence from the detailed
+ description for that item. The summary entries are alphabetical,
+ while the detailed descriptions are in the order they appear in
+ the source code. This preserves the logical groupings
+ established by the programmer.
+
+
+ Annotation Type
+
+ Each annotation type has its own separate page with the following
+ sections:
+
+ Annotation Type declaration
+ Annotation Type description
+ Required Element Summary
+ Optional Element Summary
+ Element Detail
+
+
+
+ Enum
+
+ Each enum has its own separate page with the following
+ sections:
+
+ Enum declaration
+ Enum description
+ Enum Constant Summary
+ Enum Constant Detail
+
+
+
+ Tree (Class Hierarchy)
+
+ There is a Class Hierarchy page
+ for all packages, plus a hierarchy for each package. Each
+ hierarchy page contains a list of classes and a list of
+ interfaces. The classes are organized by inheritance structure
+ starting with java.lang.Object. The interfaces do
+ not inherit from java.lang.Object.
+
+ When viewing the Overview page, clicking on "Tree" displays
+ the hierarchy for all packages.
+
+ When viewing a particular package, class or interface page,
+ clicking "Tree" displays the hierarchy for only that
+ package.
+
+
+
+
+ Deprecated API
+
+ The Deprecated API page lists
+ all of the API that have been deprecated. A deprecated API is
+ not recommended for use, generally due to improvements, and a
+ replacement API is usually given. Deprecated APIs may be removed
+ in future implementations.
+
+
+ Index
+
+ The Index contains an
+ alphabetic list of all classes, interfaces, constructors,
+ methods, and fields.
+
+
+ Prev/Next
+
+ These links take you to the next or previous class, interface,
+ package, or related page.
+
+
+ Frames/No Frames
+
+ These links show and hide the HTML frames. All pages are
+ available with or without frames.
+
+
+ All Classes
+
+ The All Classes link shows
+ all classes and interfaces except non-static nested types.
+
+
+ Serialized Form
+
+ Each serializable or externalizable class has a description of
+ its serialization fields and methods. This information is of
+ interest to re-implementors, not to developers using the API.
+ While there is no link in the navigation bar, you can get to
+ this information by going to any serialized class and clicking
+ "Serialized Form" in the "See also" section of the class
+ description.
+
+
+ Constant Field Values
+
+ The Constant Field Values page
+ lists the static final fields and their values.
+
+
+
This help file applies to API documentation generated using the standard
+ doclet.
+
+
+
+
+
+
diff --git a/docs/index-files/index-1.html b/docs/index-files/index-1.html
new file mode 100644
index 0000000..b31eb4f
--- /dev/null
+++ b/docs/index-files/index-1.html
@@ -0,0 +1,178 @@
+
+
+
+
+
+ A-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
A
+
+ Account - Class in Server
+
+ Account()
+ - Constructor for class Server.Account
+
+
+ Creates an Account object.
+
+ AccountHandler - Class in Server
+
+ AccountHandler()
+ - Constructor for class Server.AccountHandler
+
+ Constructor for the account.
+
+ addThread(Socket)
+ - Method in class Server.SmallChatServer
+
+
+ Adds a new client when needed.
+
+ attemptLogin(String)
+ - Method in class Server.AccountHandler
+
+
+ Attempt to login using the supplied password.
+
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-10.html b/docs/index-files/index-10.html
new file mode 100644
index 0000000..81eef09
--- /dev/null
+++ b/docs/index-files/index-10.html
@@ -0,0 +1,160 @@
+
+
+
+
+
+ O-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
O
+
+ open()
+ - Method in class Server.ClientThread
+
+
+ Opens the stream in to receive information from
+ the socket
+
+
+ open() -
+ Method in class Server.SmallTalkServer
+
+
+ Method for opening a new stream in
+
+ openLoginWindow()
+ - Static method in class Client.SmallTalkClient
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-11.html b/docs/index-files/index-11.html
new file mode 100644
index 0000000..031eda7
--- /dev/null
+++ b/docs/index-files/index-11.html
@@ -0,0 +1,165 @@
+
+
+
+
+
+ R-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
R
+
+ run()
+ - Method in class Client.SmallTalkClient
+
+
+ (non-Javadoc)
+
+ run()
+ - Method in class Server.ClientThread
+
+
+ Runs in the current thread.
+
+ run()
+ - Method in class Server.SmallChatServer
+
+
+ Runs the Chat server
+
+ run()
+ - Method in class Server.SmallTalkServer
+
+
+ Begins the server.
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-12.html b/docs/index-files/index-12.html
new file mode 100644
index 0000000..8b0677c
--- /dev/null
+++ b/docs/index-files/index-12.html
@@ -0,0 +1,219 @@
+
+
+
+
+
+ S-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
S
+
+ send(String)
+ - Method in class Server.SmallTalkServer
+
+
+ Sends a message
+ Temporary method...must integrate with the Common package
+
+
+ Server - package Server
+
+
+ SmallChatServer - Class in Server
+
+ SmallChatServer(int)
+ - Constructor for class Server.SmallChatServer
+
+ Constructor for SmallChatServer.
+
+ SmallTalkClient - Class in Client
+
+ SmallTalkClient()
+ - Constructor for class Client.SmallTalkClient
+
+ Constructor for starting server
+ Opens the socket at hostName and starts the server
+
+
+ SmallTalkServer - Class in Server
+
+ SmallTalkServer(SmallChatServer,
+ Socket) - Constructor for class Server.SmallTalkServer
+
+
+ Constructor for smalltalkServer
+ Creates server
+
+
+ start()
+ - Method in class Client.SmallTalkClient
+
+
+ Method that starts the thread and makes a new
+ client.
+
+
+ stop() -
+ Method in class Client.SmallTalkClient
+
+
+ Method that stops the thread and server
+
+ stop() -
+ Method in class Server.SmallChatServer
+
+
+ Method that stops the thread
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-13.html b/docs/index-files/index-13.html
new file mode 100644
index 0000000..3fdef7f
--- /dev/null
+++ b/docs/index-files/index-13.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+ T-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
T
+
+ toString()
+ - Method in class Server.Account
+
+ Used to output account information to a string.
+
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-2.html b/docs/index-files/index-2.html
new file mode 100644
index 0000000..aee29ff
--- /dev/null
+++ b/docs/index-files/index-2.html
@@ -0,0 +1,188 @@
+
+
+
+
+
+ C-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
C
+
+ Client - package Client
+
+
+ ClientThread - Class in Server
+
+ ClientThread(SmallTalkClient,
+ Socket) - Constructor for class Server.ClientThread
+
+
+ Constructor for ClientThread
+
+ close()
+ - Method in class Server.ClientThread
+
+
+ Closes the stream
+
+ close()
+ - Method in class Server.SmallTalkServer
+
+
+ Method for closing the socket, streamIn, and
+ streamOut
+
+
+ Common - package Common
+
+
+ createAccountHandler(String,
+ String, String) - Method in class Server.AccountHandler
+
+
+ Creates an account.
+
+ createUserAccount(String,
+ String, String) - Method in class Server.Account
+
+ Used to create a new SmallTalk account.
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-3.html b/docs/index-files/index-3.html
new file mode 100644
index 0000000..6f3fbb1
--- /dev/null
+++ b/docs/index-files/index-3.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+ D-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
D
+
+ doesAccountExist(String)
+ - Method in class Server.Account
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-4.html b/docs/index-files/index-4.html
new file mode 100644
index 0000000..7204c19
--- /dev/null
+++ b/docs/index-files/index-4.html
@@ -0,0 +1,154 @@
+
+
+
+
+
+ F-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
F
+
+ fetchAccountInfo(String)
+ - Method in class Server.Account
+
+ Used to populate the password and identity field
+ for Account objects.
+
+
+ forgotAccountHandler(String)
+ - Method in class Server.AccountHandler
+
+
+ Handles password recovery.
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-5.html b/docs/index-files/index-5.html
new file mode 100644
index 0000000..6058385
--- /dev/null
+++ b/docs/index-files/index-5.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+ G-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
G
+
+ getPassword()
+ - Method in class Server.Account
+
+ Used to send password information to other
+ classes
+
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-6.html b/docs/index-files/index-6.html
new file mode 100644
index 0000000..ded3901
--- /dev/null
+++ b/docs/index-files/index-6.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+ H-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
H
+
+ hashPassword(String)
+ - Method in class Server.Account
+
+ Used to encrypt account information
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-7.html b/docs/index-files/index-7.html
new file mode 100644
index 0000000..2e6a414
--- /dev/null
+++ b/docs/index-files/index-7.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+ I-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
I
+
+ isUsernameTaken(String)
+ - Method in class Server.Account
+
+ Used to see if a username is taken.
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-8.html b/docs/index-files/index-8.html
new file mode 100644
index 0000000..4929260
--- /dev/null
+++ b/docs/index-files/index-8.html
@@ -0,0 +1,151 @@
+
+
+
+
+
+ L-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
L
+
+ loginAccount
+ - Variable in class Server.AccountHandler
+
+
+ loginAccountHandler(String,
+ String) - Method in class Server.AccountHandler
+
+
+ Handles logging in for the account.
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index-files/index-9.html b/docs/index-files/index-9.html
new file mode 100644
index 0000000..355502a
--- /dev/null
+++ b/docs/index-files/index-9.html
@@ -0,0 +1,164 @@
+
+
+
+
+
+ M-Index
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+A C D F G H I L M O R S T
+
+
+
+
M
+
+ main(String[])
+ - Static method in class Client.SmallTalkClient
+
+ MessageReceiver - Class in Common
+
+ MessageReceiver()
+ - Constructor for class Common.MessageReceiver
+
+ MessageSender - Class in Common
+
+ MessageSender(Account[])
+ - Constructor for class Common.MessageSender
+
+
+
+
A C D F G H I L M O R S T
+
+
+
+
+
+
+
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 0000000..4e9cd58
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+ Generated Documentation (Untitled)
+
+
+
+
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+ Frame Alert
+
+ This document is designed to be viewed using the frames feature. If
+ you see this message, you are using a non-frame-capable web client.
+ Link to Non-frame version .
+
+
+
diff --git a/docs/overview-frame.html b/docs/overview-frame.html
new file mode 100644
index 0000000..ec6c1b3
--- /dev/null
+++ b/docs/overview-frame.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+ Overview List
+
+
+
+
+
+
+
+
+
diff --git a/docs/overview-summary.html b/docs/overview-summary.html
new file mode 100644
index 0000000..792d11a
--- /dev/null
+++ b/docs/overview-summary.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+ Overview
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+ Packages
+
+
+ Package
+ Description
+
+
+
+ Client
+
+
+
+ Common
+
+
+
+ Server
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/overview-tree.html b/docs/overview-tree.html
new file mode 100644
index 0000000..e9983a0
--- /dev/null
+++ b/docs/overview-tree.html
@@ -0,0 +1,167 @@
+
+
+
+
+
+ Class Hierarchy
+
+
+
+
+
+
+ JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/package-list b/docs/package-list
new file mode 100644
index 0000000..867af65
--- /dev/null
+++ b/docs/package-list
@@ -0,0 +1,3 @@
+Client
+Common
+Server
diff --git a/docs/resources/background.gif b/docs/resources/background.gif
new file mode 100644
index 0000000..f471940
Binary files /dev/null and b/docs/resources/background.gif differ
diff --git a/docs/resources/tab.gif b/docs/resources/tab.gif
new file mode 100644
index 0000000..1a73a83
Binary files /dev/null and b/docs/resources/tab.gif differ
diff --git a/docs/resources/titlebar.gif b/docs/resources/titlebar.gif
new file mode 100644
index 0000000..17443b3
Binary files /dev/null and b/docs/resources/titlebar.gif differ
diff --git a/docs/resources/titlebar_end.gif b/docs/resources/titlebar_end.gif
new file mode 100644
index 0000000..3ad78d4
Binary files /dev/null and b/docs/resources/titlebar_end.gif differ
diff --git a/docs/stylesheet.css b/docs/stylesheet.css
new file mode 100644
index 0000000..0aeaa97
--- /dev/null
+++ b/docs/stylesheet.css
@@ -0,0 +1,474 @@
+/* Javadoc style sheet */
+/*
+Overall document style
+*/
+body {
+ background-color:#ffffff;
+ color:#353833;
+ font-family:Arial, Helvetica, sans-serif;
+ font-size:76%;
+ margin:0;
+}
+a:link, a:visited {
+ text-decoration:none;
+ color:#4c6b87;
+}
+a:hover, a:focus {
+ text-decoration:none;
+ color:#bb7a2a;
+}
+a:active {
+ text-decoration:none;
+ color:#4c6b87;
+}
+a[name] {
+ color:#353833;
+}
+a[name]:hover {
+ text-decoration:none;
+ color:#353833;
+}
+pre {
+ font-size:1.3em;
+}
+h1 {
+ font-size:1.8em;
+}
+h2 {
+ font-size:1.5em;
+}
+h3 {
+ font-size:1.4em;
+}
+h4 {
+ font-size:1.3em;
+}
+h5 {
+ font-size:1.2em;
+}
+h6 {
+ font-size:1.1em;
+}
+ul {
+ list-style-type:disc;
+}
+code, tt {
+ font-size:1.2em;
+}
+dt code {
+ font-size:1.2em;
+}
+table tr td dt code {
+ font-size:1.2em;
+ vertical-align:top;
+}
+sup {
+ font-size:.6em;
+}
+/*
+Document title and Copyright styles
+*/
+.clear {
+ clear:both;
+ height:0px;
+ overflow:hidden;
+}
+.aboutLanguage {
+ float:right;
+ padding:0px 21px;
+ font-size:.8em;
+ z-index:200;
+ margin-top:-7px;
+}
+.legalCopy {
+ margin-left:.5em;
+}
+.bar a, .bar a:link, .bar a:visited, .bar a:active {
+ color:#FFFFFF;
+ text-decoration:none;
+}
+.bar a:hover, .bar a:focus {
+ color:#bb7a2a;
+}
+.tab {
+ background-color:#0066FF;
+ background-image:url(resources/titlebar.gif);
+ background-position:left top;
+ background-repeat:no-repeat;
+ color:#ffffff;
+ padding:8px;
+ width:5em;
+ font-weight:bold;
+}
+/*
+Navigation bar styles
+*/
+.bar {
+ background-image:url(resources/background.gif);
+ background-repeat:repeat-x;
+ color:#FFFFFF;
+ padding:.8em .5em .4em .8em;
+ height:auto;/*height:1.8em;*/
+ font-size:1em;
+ margin:0;
+}
+.topNav {
+ background-image:url(resources/background.gif);
+ background-repeat:repeat-x;
+ color:#FFFFFF;
+ float:left;
+ padding:0;
+ width:100%;
+ clear:right;
+ height:2.8em;
+ padding-top:10px;
+ overflow:hidden;
+}
+.bottomNav {
+ margin-top:10px;
+ background-image:url(resources/background.gif);
+ background-repeat:repeat-x;
+ color:#FFFFFF;
+ float:left;
+ padding:0;
+ width:100%;
+ clear:right;
+ height:2.8em;
+ padding-top:10px;
+ overflow:hidden;
+}
+.subNav {
+ background-color:#dee3e9;
+ border-bottom:1px solid #9eadc0;
+ float:left;
+ width:100%;
+ overflow:hidden;
+}
+.subNav div {
+ clear:left;
+ float:left;
+ padding:0 0 5px 6px;
+}
+ul.navList, ul.subNavList {
+ float:left;
+ margin:0 25px 0 0;
+ padding:0;
+}
+ul.navList li{
+ list-style:none;
+ float:left;
+ padding:3px 6px;
+}
+ul.subNavList li{
+ list-style:none;
+ float:left;
+ font-size:90%;
+}
+.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
+ color:#FFFFFF;
+ text-decoration:none;
+}
+.topNav a:hover, .bottomNav a:hover {
+ text-decoration:none;
+ color:#bb7a2a;
+}
+.navBarCell1Rev {
+ background-image:url(resources/tab.gif);
+ background-color:#a88834;
+ color:#FFFFFF;
+ margin: auto 5px;
+ border:1px solid #c9aa44;
+}
+/*
+Page header and footer styles
+*/
+.header, .footer {
+ clear:both;
+ margin:0 20px;
+ padding:5px 0 0 0;
+}
+.indexHeader {
+ margin:10px;
+ position:relative;
+}
+.indexHeader h1 {
+ font-size:1.3em;
+}
+.title {
+ color:#2c4557;
+ margin:10px 0;
+}
+.subTitle {
+ margin:5px 0 0 0;
+}
+.header ul {
+ margin:0 0 25px 0;
+ padding:0;
+}
+.footer ul {
+ margin:20px 0 5px 0;
+}
+.header ul li, .footer ul li {
+ list-style:none;
+ font-size:1.2em;
+}
+/*
+Heading styles
+*/
+div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
+ background-color:#dee3e9;
+ border-top:1px solid #9eadc0;
+ border-bottom:1px solid #9eadc0;
+ margin:0 0 6px -8px;
+ padding:2px 5px;
+}
+ul.blockList ul.blockList ul.blockList li.blockList h3 {
+ background-color:#dee3e9;
+ border-top:1px solid #9eadc0;
+ border-bottom:1px solid #9eadc0;
+ margin:0 0 6px -8px;
+ padding:2px 5px;
+}
+ul.blockList ul.blockList li.blockList h3 {
+ padding:0;
+ margin:15px 0;
+}
+ul.blockList li.blockList h2 {
+ padding:0px 0 20px 0;
+}
+/*
+Page layout container styles
+*/
+.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
+ clear:both;
+ padding:10px 20px;
+ position:relative;
+}
+.indexContainer {
+ margin:10px;
+ position:relative;
+ font-size:1.0em;
+}
+.indexContainer h2 {
+ font-size:1.1em;
+ padding:0 0 3px 0;
+}
+.indexContainer ul {
+ margin:0;
+ padding:0;
+}
+.indexContainer ul li {
+ list-style:none;
+}
+.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
+ font-size:1.1em;
+ font-weight:bold;
+ margin:10px 0 0 0;
+ color:#4E4E4E;
+}
+.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
+ margin:10px 0 10px 20px;
+}
+.serializedFormContainer dl.nameValue dt {
+ margin-left:1px;
+ font-size:1.1em;
+ display:inline;
+ font-weight:bold;
+}
+.serializedFormContainer dl.nameValue dd {
+ margin:0 0 0 1px;
+ font-size:1.1em;
+ display:inline;
+}
+/*
+List styles
+*/
+ul.horizontal li {
+ display:inline;
+ font-size:0.9em;
+}
+ul.inheritance {
+ margin:0;
+ padding:0;
+}
+ul.inheritance li {
+ display:inline;
+ list-style:none;
+}
+ul.inheritance li ul.inheritance {
+ margin-left:15px;
+ padding-left:15px;
+ padding-top:1px;
+}
+ul.blockList, ul.blockListLast {
+ margin:10px 0 10px 0;
+ padding:0;
+}
+ul.blockList li.blockList, ul.blockListLast li.blockList {
+ list-style:none;
+ margin-bottom:25px;
+}
+ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
+ padding:0px 20px 5px 10px;
+ border:1px solid #9eadc0;
+ background-color:#f9f9f9;
+}
+ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
+ padding:0 0 5px 8px;
+ background-color:#ffffff;
+ border:1px solid #9eadc0;
+ border-top:none;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
+ margin-left:0;
+ padding-left:0;
+ padding-bottom:15px;
+ border:none;
+ border-bottom:1px solid #9eadc0;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
+ list-style:none;
+ border-bottom:none;
+ padding-bottom:0;
+}
+table tr td dl, table tr td dl dt, table tr td dl dd {
+ margin-top:0;
+ margin-bottom:1px;
+}
+/*
+Table styles
+*/
+.contentContainer table, .classUseContainer table, .constantValuesContainer table {
+ border-bottom:1px solid #9eadc0;
+ width:100%;
+}
+.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
+ width:100%;
+}
+.contentContainer .description table, .contentContainer .details table {
+ border-bottom:none;
+}
+.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{
+ vertical-align:top;
+ padding-right:20px;
+}
+.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
+.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
+.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
+.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
+ padding-right:3px;
+}
+.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
+ position:relative;
+ text-align:left;
+ background-repeat:no-repeat;
+ color:#FFFFFF;
+ font-weight:bold;
+ clear:none;
+ overflow:hidden;
+ padding:0px;
+ margin:0px;
+}
+caption a:link, caption a:hover, caption a:active, caption a:visited {
+ color:#FFFFFF;
+}
+.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
+ white-space:nowrap;
+ padding-top:8px;
+ padding-left:8px;
+ display:block;
+ float:left;
+ background-image:url(resources/titlebar.gif);
+ height:18px;
+}
+.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
+ width:10px;
+ background-image:url(resources/titlebar_end.gif);
+ background-repeat:no-repeat;
+ background-position:top right;
+ position:relative;
+ float:left;
+}
+ul.blockList ul.blockList li.blockList table {
+ margin:0 0 12px 0px;
+ width:100%;
+}
+.tableSubHeadingColor {
+ background-color: #EEEEFF;
+}
+.altColor {
+ background-color:#eeeeef;
+}
+.rowColor {
+ background-color:#ffffff;
+}
+.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
+ text-align:left;
+ padding:3px 3px 3px 7px;
+}
+th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
+ background:#dee3e9;
+ border-top:1px solid #9eadc0;
+ border-bottom:1px solid #9eadc0;
+ text-align:left;
+ padding:3px 3px 3px 7px;
+}
+td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
+ font-weight:bold;
+}
+td.colFirst, th.colFirst {
+ border-left:1px solid #9eadc0;
+ white-space:nowrap;
+}
+td.colLast, th.colLast {
+ border-right:1px solid #9eadc0;
+}
+td.colOne, th.colOne {
+ border-right:1px solid #9eadc0;
+ border-left:1px solid #9eadc0;
+}
+table.overviewSummary {
+ padding:0px;
+ margin-left:0px;
+}
+table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
+table.overviewSummary td.colOne, table.overviewSummary th.colOne {
+ width:25%;
+ vertical-align:middle;
+}
+table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
+ width:25%;
+ vertical-align:middle;
+}
+/*
+Content styles
+*/
+.description pre {
+ margin-top:0;
+}
+.deprecatedContent {
+ margin:0;
+ padding:10px 0;
+}
+.docSummary {
+ padding:0;
+}
+/*
+Formatting effect styles
+*/
+.sourceLineNo {
+ color:green;
+ padding:0 30px 0 0;
+}
+h1.hidden {
+ visibility:hidden;
+ overflow:hidden;
+ font-size:.9em;
+}
+.block {
+ display:block;
+ margin:3px 0 0 0;
+}
+.strong {
+ font-weight:bold;
+}
diff --git a/src/Client/smalltalkClient.java b/src/Client/smalltalkClient.java
index 3387663..1950d39 100644
--- a/src/Client/smalltalkClient.java
+++ b/src/Client/smalltalkClient.java
@@ -1,27 +1,27 @@
-package client;
+package Client;
+
+import Server.ClientThread;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
-import server.ClientThread;
+public class SmallTalkClient implements Runnable {
- public class SmalltalkClient implements Runnable{
-
static int clientPort;
static int serverPort = 4242; //Random port number
static String hostName = "localhost"; //Temporary host name
private Socket socket = null;
private Thread thread = null;
- private DataInputStream console = null;
+ private DataInputStream console = null;
private DataOutputStream streamOut = null;
private ClientThread client = null;
-
-
+
+
public static void main(String[] args) {
-
+
openLoginWindow(); // Opens login GUI
/*
@@ -29,74 +29,80 @@ public static void main(String[] args) {
* - Logging in
* - Creating new account
*/
- SmalltalkClient client = new SmalltalkClient();
-
+ SmallTalkClient client = new SmallTalkClient();
+
}
-
+
public static void openLoginWindow() {
-
+
}
-
- /*
+
+ /**
* Constructor for starting server
* Opens the socket at hostName and starts the server
*/
- public SmalltalkClient(){
+ public SmallTalkClient() {
System.out.println("Establishing connection...");
- try{
+ try {
socket = new Socket(hostName, serverPort);
System.out.println("Connected to " + socket);
start();
- }catch(Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
-
- /*
- * Method that starts the thread and makes a new client
+
+ /**
+ * Method that starts the thread and makes a new client.
+ *
+ * @throws IOException
*/
-
- public void start() throws IOException{
+
+ public void start() throws IOException {
console = new DataInputStream(System.in);
streamOut = new DataOutputStream(socket.getOutputStream());
- if (thread == null){
+ if (thread == null) {
client = new ClientThread(this, socket);
- thread = new Thread(this);
+ thread = new Thread(this);
thread.start();
}
}
-
- /*
- * Method that stops the thread and server
+
+ /**
+ * Method that stops the thread and server
+ *
+ * @throws IOException
*/
- public void stop() throws IOException{
- if(thread != null){
- thread.stop();
+ public void stop() throws IOException {
+ if (thread != null) {
+ thread.stop();
thread = null;
}
- try{
- if(console != null)
+ try {
+ if (console != null)
console.close();
- if(streamOut != null)
+ if (streamOut != null)
streamOut.close();
- if(socket != null)
+ if (socket != null)
socket.close();
- }catch(Exception e){
- System.out.println("Error closing ...");
+ } catch (Exception e) {
+ System.out.println("Error closing ...");
}
- client.close();
+ client.close();
client.stop();
}
- /*
+
+ /**
* (non-Javadoc)
+ *
* @see java.lang.Runnable#run()
*/
public void run() {
- while(thread != null){
- try{
- streamOut.writeUTF(console.readLine());
- streamOut.flush();
- }catch(Exception e){
+ while (thread != null) {
+ try {
+ streamOut.writeUTF(console.readLine());
+ streamOut.flush();
+ } catch (Exception e) {
e.printStackTrace();
try {
stop();
@@ -105,7 +111,7 @@ public void run() {
}
}
}
-
+
}
-
+
}
diff --git a/src/Common/messageReceiver.java b/src/Common/messageReceiver.java
index da15a9a..84bcbc1 100644
--- a/src/Common/messageReceiver.java
+++ b/src/Common/messageReceiver.java
@@ -1,4 +1,4 @@
-package common;
+package Common;
public class MessageReceiver {
diff --git a/src/Common/messageSender.java b/src/Common/messageSender.java
index 0cec788..bc99542 100644
--- a/src/Common/messageSender.java
+++ b/src/Common/messageSender.java
@@ -1,11 +1,11 @@
-package common;
+package Common;
-import server.Account;
+import Server.Account;
public class MessageSender {
-
+
public MessageSender(Account[] accounts) {
-
+
}
}
diff --git a/src/Server/ClientThread.java b/src/Server/ClientThread.java
index 3b714a6..eee7d43 100644
--- a/src/Server/ClientThread.java
+++ b/src/Server/ClientThread.java
@@ -1,56 +1,63 @@
-package server;
+package Server;
+
+import Client.SmallTalkClient;
import java.io.DataInputStream;
import java.net.Socket;
-import client.SmalltalkClient;
-
-public class ClientThread extends Thread{
+public class ClientThread extends Thread {
private Socket socket = null;
- private SmalltalkClient client = null;
+ private SmallTalkClient client = null;
private DataInputStream streamIn = null;
-
- /*
+
+ /**
* Constructor for ClientThread
+ *
+ * @param client The SmallTalkClient object to supply.
+ * @param socket The Socket Object to bind too.
*/
- public ClientThread(SmalltalkClient client, Socket socket){
+ public ClientThread(SmallTalkClient client, Socket socket) {
this.client = client;
this.socket = socket;
open();
start();
}
-
- /*
+
+ /**
* Opens the stream in to receive information from the socket
*/
- public void open(){
- try{
+ public void open() {
+ try {
streamIn = new DataInputStream(socket.getInputStream());
- }catch(Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
- /*
+
+ /**
* Closes the stream
*/
- public void close(){
- try{
- if(streamIn != null)
+ public void close() {
+ try {
+ if (streamIn != null)
streamIn.close();
- }catch(Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
- /*
+
+ /**
+ * Runs in the current thread.
* (non-Javadoc)
+ *
* @see java.lang.Thread#run()
*/
- public void run(){
- while(true){
- try{
+ public void run() {
+ while (true) {
+ try {
System.out.println("running");
- }catch(Exception e){
+ } catch (Exception e) {
e.printStackTrace();
try {
client.stop();
diff --git a/src/Server/SmallChatServer.java b/src/Server/SmallChatServer.java
index 6a04e00..05fcb3a 100644
--- a/src/Server/SmallChatServer.java
+++ b/src/Server/SmallChatServer.java
@@ -1,75 +1,81 @@
-package server;
+package Server;
import java.net.ServerSocket;
import java.net.Socket;
-public class SmallChatServer implements Runnable{
+public class SmallChatServer implements Runnable {
private ServerSocket server = null;
private Thread thread = null;
- private SmalltalkServer client = null;
-
- /*
- * Constructor for SmallChatServer
- * Parameters - port as an integer
+ private SmallTalkServer client = null; //TODO: THIS SEEMS WONKY
+
+ /**
+ * Constructor for SmallChatServer.
+ *
* Binds to port and begins the server
+ *
+ * @param port Port number to bind to as an integer
*/
- public SmallChatServer(int port){
- try{
+ public SmallChatServer(int port) {
+ try {
System.out.println("Binding to port " + port + ", please wait...");
server = new ServerSocket(port);
System.out.println("Server started: " + server);
start();
- }catch(Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
- /*
+
+ /**
* Method that starts the thread
*/
- private void start(){
- if (thread == null){
- thread = new Thread(this);
+ private void start() {
+ if (thread == null) {
+ thread = new Thread(this);
thread.start();
- }
+ }
}
-
- /*
+
+ /**
* Method that stops the thread
*/
- public void stop(){
- if (thread != null){
- thread.stop();
- thread = null;
+ public void stop() {
+ if (thread != null) {
+ thread.stop();
+ thread = null;
}
}
- /*
- * (non-Javadoc)
+
+ /**
+ * Runs the Chat server
+ *
* @see java.lang.Runnable#run()
*/
public void run() {
- while(thread != null){
- try{
+ while (thread != null) {
+ try {
System.out.println("Waiting for client...");
addThread(server.accept());
- }catch(Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
-
+
}
- /*
- * Adds a new client when needed
- * Parameters - Socket
- * Accepts client and starts their thread
+
+ /**
+ * Adds a new client when needed. Accepts client and starts their thread
+ *
+ * @param socket The socket object to bind too.
*/
- public void addThread(Socket socket){
+ public void addThread(Socket socket) {
System.out.println("Accepting client...");
- client = new SmalltalkServer(this, socket);
- try{
+ client = new SmallTalkServer(this, socket);
+ try {
client.open();
client.start();
- }catch(Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
diff --git a/src/Server/account.java b/src/Server/account.java
index 6e68c09..7bb5dfc 100644
--- a/src/Server/account.java
+++ b/src/Server/account.java
@@ -15,7 +15,7 @@
* For existing account information see accounts file.
*/
-package server;
+package Server;
import java.io.BufferedWriter;
import java.io.File;
@@ -25,7 +25,7 @@
import java.security.NoSuchAlgorithmException;
import java.util.Scanner;
-public class Account{
+public class Account {
private String email;
private String username;
@@ -33,7 +33,7 @@ public class Account{
// public String lastLogin;
- /*
+ /**
* Creates an Account object.
* Identifies its Username that was passed in by loginHandler or Client.
* Fetches the rest of account info from accounts file afterwards.
@@ -43,15 +43,19 @@ public Account() {
}
- /*
+ /**
* Used to create a new SmallTalk account.
* Parameters will be passed in from client.
* Identifies username, password and user identity.
* Afterwards, the account information is written to the accounts file.
+ *
+ * @param username The username of the account.
+ * @param password The password of the account.
+ * @param email The email of the account.
*/
public void createUserAccount(String username, String password, String email) {
-
+
this.email = email;
this.username = username;
this.password = password;
@@ -59,28 +63,30 @@ public void createUserAccount(String username, String password, String email) {
saveAccount();
}
- /*
+ /**
* Used to populate the password and identity field for Account objects.
* If the username exists in the accounts file, then this method fetches
- * the password and identity.
+ * the password and identity.
* If the username does not exist in the accounts file, the password
* and the identity are left as null.
- * This allows for the creation of new accounts.
+ * This allows for the creation of new accounts.
+ *
+ * @param email The email to be used.
*/
public void fetchAccountInfo(String email) {
this.email = email;
- File accounts = new java.io.File("accounts.txt");
+ File accounts = new java.io.File("accounts.txt");
try {
Scanner accountFinder = new Scanner(accounts);
- while(accountFinder.hasNextLine()) {
+ while (accountFinder.hasNextLine()) {
if (accountFinder.nextLine().equals("email: " + email)) {
String userPassword = accountFinder.nextLine().toString();
- this.username = userPassword.replace("username: ", "");
+ this.username = userPassword.replace("username: ", "");
String userIdentity = accountFinder.nextLine().toString();
- this.password = userIdentity.replace("password: ", "");
+ this.password = userIdentity.replace("password: ", "");
}
}
accountFinder.close();
@@ -90,28 +96,32 @@ public void fetchAccountInfo(String email) {
}
}
- /*
- * Used to see if a username is taken.
- * As of now this is not used locally. Client will use this later on
- * in order to see if a username is free for use.
- * Checks if password field is null, if so then the user account is not
- * already in the accounts file.
- */
public boolean doesAccountExist(String email) {
fetchAccountInfo(email);
- if(this.password != null) return true;
+ if (this.password != null) return true;
else return false;
}
+ /**
+ * Used to see if a username is taken.
+ * As of now this is not used locally. Client will use this later on
+ * in order to see if a username is free for use.
+ * Checks if password field is null, if so then the user account is not
+ * already in the accounts file.
+ *
+ * @param username The username to be used.
+ * @return A boolean value of True if the username is taken.
+ */
+
public boolean isUsernameTaken(String username) {
- File accounts = new java.io.File("accounts.txt");
+ File accounts = new java.io.File("accounts.txt");
try {
Scanner accountFinder = new Scanner(accounts);
- while(accountFinder.hasNextLine()) {
+ while (accountFinder.hasNextLine()) {
if (accountFinder.nextLine().equals("username: " + username)) {
accountFinder.close();
return true;
@@ -125,17 +135,17 @@ public boolean isUsernameTaken(String username) {
return false;
}
- /*
+ /**
* Currently writes the users new account out to a plain text accounts file.
* Writes real name, username, and then password.
- * TODO Write to some sort of database.
- * Encrypt stored user information.
- * Return an actual error.
+ * TODO Write to some sort of database.
+ * Encrypt stored user information.
+ * Return an actual error.
*/
private void saveAccount() {
- try{
+ try {
FileWriter accountWriter = new FileWriter("accounts.txt", true);
BufferedWriter out = new BufferedWriter(accountWriter);
out.newLine();
@@ -147,14 +157,16 @@ private void saveAccount() {
out.newLine();
out.flush();
out.close();
- }catch (Exception e){
+ } catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
- /*
+ /**
* Used to output account information to a string.
* Will be used by the Client to display account information if requested.
+ *
+ * @return The account data as a string.
*/
public String toString() {
@@ -162,50 +174,48 @@ public String toString() {
return "username: " + username + "\npassword: " + password
+ "\nemail: " + email;
}
-
- /*
+
+ /**
* Used to send password information to other classes
- * Parameters - none
- * Returns - password as a String
- *
+ *
+ * @return Password as a String
*/
-
- public String getPassword(){
+
+ public String getPassword() {
return this.password;
}
-
- /*
- *
+
+ /**
* Used to encrypt account information
- * Parameters - String that is to be encrypted
- * Returns - The encrypted string in hex format
- *
+ *
+ * @param pass String that is to be encrypted
+ * @return The encrypted string in hex format
+ * @throws NoSuchAlgorithmException
*/
-
- public String hashPassword(String pass) throws NoSuchAlgorithmException{
+
+ public String hashPassword(String pass) throws NoSuchAlgorithmException {
MessageDigest mess = MessageDigest.getInstance("MD5");
mess.update(pass.getBytes());
byte digest[] = mess.digest();
return toHexString(digest);
}
-
- /*
- *
+
+ /**
* Used to convert a byte array to hex
- * Parameters - byte array
- * Returns - String in hex format
- *
+ *
+ * @param bytes The byte array
+ * @return A String in hex format
*/
-
+
private String toHexString(byte[] bytes) {
- final char[] hexArray = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
- char[] hexChars = new char[bytes.length * 2];
- int v;
- for ( int j = 0; j < bytes.length; j++ ) {
- v = bytes[j] & 0xFF;
- hexChars[j * 2] = hexArray[v >>> 4];
- hexChars[j * 2 + 1] = hexArray[v & 0x0F];
- }
- return new String(hexChars);
+ final char[] hexArray = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+ char[] hexChars = new char[bytes.length * 2];
+ int v;
+ for (int j = 0; j < bytes.length; j++) {
+ v = bytes[j] & 0xFF;
+ hexChars[j * 2] = hexArray[v >>> 4];
+ hexChars[j * 2 + 1] = hexArray[v & 0x0F];
+ }
+ return new String(hexChars);
}
}
diff --git a/src/Server/accountHandler.java b/src/Server/accountHandler.java
index a444516..647e813 100644
--- a/src/Server/accountHandler.java
+++ b/src/Server/accountHandler.java
@@ -1,46 +1,83 @@
-package server;
+package Server;
import java.security.NoSuchAlgorithmException;
-public class AccountHandler{
-
+public class AccountHandler {
+
public Account loginAccount;
+
+ /**
+ * Constructor for the account.
+ */
public AccountHandler() {
}
+ /**
+ * Handles logging in for the account.
+ *
+ * @param username The username of the account
+ * @param password The password of the account
+ * @return A boolean value of true if account exists.
+ * @throws NoSuchAlgorithmException
+ */
+
public boolean loginAccountHandler(String username, String password) throws NoSuchAlgorithmException {
- if(loginAccount.doesAccountExist(username)) {
- if(attemptLogin(password))
+ if (loginAccount.doesAccountExist(username)) {
+ if (attemptLogin(password))
return true;
}
return false;
}
+ /**
+ * Creates an account.
+ *
+ * @param username The username to be associated with the account
+ * @param password The password to be associated with the account
+ * @param email The email to be assocaited with the account.
+ * @return A boolean value of false if the account already exists
+ */
+
public boolean createAccountHandler(String username, String password, String email) {
-
- if(!loginAccount.doesAccountExist(username)) {
+
+ if (!loginAccount.doesAccountExist(username)) {
loginAccount.createUserAccount(username, password, email);
return true;
}
return false;
}
-
+
+ /**
+ * Handles password recovery.
+ *
+ * @param email The email to be used for recovery.
+ * @return An account object associated with the email.
+ */
+
public Account forgotAccountHandler(String email) {
-
- if(loginAccount.doesAccountExist(email)) {
+
+ if (loginAccount.doesAccountExist(email)) {
loginAccount.fetchAccountInfo(email);
return loginAccount;
}
return null;
-
+
}
- public boolean attemptLogin(String password) throws NoSuchAlgorithmException {
+ /**
+ * Attempt to login using the supplied password.
+ *
+ * @param password The password to be used.
+ * @return A boolean value of true if the password is the correct password.
+ * @throws NoSuchAlgorithmException
+ */
+
+ public boolean attemptLogin(String password) throws NoSuchAlgorithmException {
- if (loginAccount.getPassword().equals(loginAccount.hashPassword(password)))
+ if (loginAccount.getPassword().equals(loginAccount.hashPassword(password)))
return true;
else
return false;
diff --git a/src/Server/smalltalkServer.java b/src/Server/smalltalkServer.java
index ffb88d3..d2828fe 100644
--- a/src/Server/smalltalkServer.java
+++ b/src/Server/smalltalkServer.java
@@ -1,4 +1,4 @@
-package server;
+package Server;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
@@ -7,7 +7,7 @@
import java.net.DatagramPacket;
import java.net.Socket;
-public class SmalltalkServer extends Thread {
+public class SmallTalkServer extends Thread {
DatagramPacket pkt;
private Socket socket = null;
@@ -16,64 +16,70 @@ public class SmalltalkServer extends Thread {
private DataInputStream streamIn = null;
private DataOutputStream streamOut = null;
- /*
+ /**
* Constructor for smalltalkServer
* Creates server
+ *
+ * @param server The server object to supply to the constructor
+ * @param socket The socket which to open the server
*/
- public SmalltalkServer(SmallChatServer server, Socket socket) {
+ public SmallTalkServer(SmallChatServer server, Socket socket) {
this.server = server;
this.socket = socket;
ID = socket.getPort();
}
- /*
- * (non-Javadoc)
+ /**
+ * Begins the server.
+ *
* @see java.lang.Thread#run()
*/
public void run() {
System.out.println("Server thread " + ID + " running...");
- while(true){
- try{
+ while (true) {
+ try {
System.out.println(streamIn.readUTF());
- }catch(Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
}
-
- /*
+
+ /**
* Sends a message
* Temporary method...must integrate with the Common package
+ *
+ * @param msg The message to be sent
*/
- public void send(String msg){
- try{
+ public void send(String msg) {
+ try {
streamOut.writeUTF(msg);
streamOut.flush();
- }catch(Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
-
- /*
+
+ /**
* Method for opening a new stream in
*/
- public void open(){
- try{
+ public void open() {
+ try {
streamIn = new DataInputStream(new BufferedInputStream(socket.getInputStream()));
- }catch (IOException e){
+ } catch (IOException e) {
e.printStackTrace();
}
}
-
- /*
+
+ /**
* Method for closing the socket, streamIn, and streamOut
*/
- public void close() throws IOException{
- if(socket != null)
+ public void close() throws IOException {
+ if (socket != null)
socket.close();
- if(streamIn != null)
+ if (streamIn != null)
streamIn.close();
- if(streamOut != null)
+ if (streamOut != null)
streamOut.close();
}
}