Server
Class Conversation

java.lang.Object
  extended by Server.Conversation

public class Conversation
extends java.lang.Object


Constructor Summary
Conversation(User creator, Server server)
           
 
Method Summary
 void addUser(User newUser)
          Adds a user to a conversation.
 int getConvID()
          Gets gonversation ID.
 java.lang.String[] getUserList()
           
 void inviteUser(User newUser)
          Invite a user to a conversation.
 void relayText(java.lang.String msg, User sender)
          Relays a String message to all Users in the conversation _except_ the sender
 void removeUser(User user)
          Removes a user to a conversation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Conversation

public Conversation(User creator,
                    Server server)
Method Detail

getConvID

public int getConvID()
Gets gonversation ID. Unsynchronized, as it never changes.

Returns:
the conversation ID as an int

relayText

public void relayText(java.lang.String msg,
                      User sender)
Relays a String message to all Users in the conversation _except_ the sender

Parameters:
msg - String specifying the message to relay to all members
sender - User specifying which user to not send a message to

addUser

public void addUser(User newUser)
Adds a user to a conversation. All users in the conversation, including the new user, are sent a list of current users (inconv [users]*)

Parameters:
newUser - User to be added

removeUser

public void removeUser(User user)
Removes a user to a conversation. All remaining users in the conversation are sent a list of current users (inconv [users]*)

Parameters:
user -

inviteUser

public void inviteUser(User newUser)
Invite a user to a conversation. ("invited " [convID] [other users in conversation]*)

Parameters:
newUser - user to be invited

getUserList

public java.lang.String[] getUserList()
Returns:
Sorted list of user names in the conversation