Server
Class User

java.lang.Object
  extended by java.lang.Thread
      extended by Server.User
All Implemented Interfaces:
java.lang.Runnable

public class User
extends 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
User(Server server, java.net.Socket socket)
          Create a thread for a User.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getUserName()
           
 void run()
           
 void sendMsg(java.lang.String message)
           
 void whoinconv(java.lang.String convIDStr)
          Tells the user who is in a conversation if it exists.
 void whoishere()
          Tells the user who else is connected to the server.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

User

public User(Server server,
            java.net.Socket socket)
     throws java.io.IOException
Create a thread for a User.

Parameters:
server -
socket - socket that the user communicates with
Throws:
java.io.IOException - if the socket cannot have writers and readers set up on it
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

sendMsg

public void sendMsg(java.lang.String message)
Parameters:
message - to be sent to User

whoinconv

public void whoinconv(java.lang.String convIDStr)
Tells the user who is in a conversation if it exists. "inconv [users]*"


whoishere

public void whoishere()
Tells the user who else is connected to the server. "ishere [users]*"


getUserName

public java.lang.String getUserName()
Returns:
username of the user

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object