Babylon Java Chat

Class BabylonChatRoom

java.lang.Object
  extended by BabylonChatRoom

public class BabylonChatRoom
extends java.lang.Object

A class to represent chat rooms. Used by both the server and the client, this class contains the name of the chat room and other attributes, plus lists of users in the room, users invited to the room, users banned from the room, and the drawing canvas history.

Author:
Andy McLaughlin

Field Summary
protected  java.util.Vector bannedUserNames
           
protected  java.util.Vector canvasHistory
           
protected  java.lang.String creatorName
           
protected  java.util.Vector invitedUsers
           
protected  java.lang.String name
           
protected  java.lang.String password
           
protected  boolean priv
           
protected  java.util.Vector users
           
 
Constructor Summary
BabylonChatRoom(java.lang.String n, java.lang.String c, boolean pr, java.lang.String pa)
           
 
Method Summary
protected  void addUser(BabylonServerConnection newConnection)
          Add a client to this chatroom
protected  void allowUserName(java.lang.String userName)
          Remove the user name from the list of banned users
protected  void banUserName(java.lang.String userName)
          Add the user name to the list of banned users.
protected  void finalize()
           
protected  void inviteUser(int userId)
          Invite a client to this chatroom
protected  void log(java.lang.String logText)
           
protected  void removeUser(BabylonServerConnection oldConnection)
          Remove a client from this chatroom
protected  void setLogging(boolean onOff)
          Turn logging on or off for this chat room
protected  void uninviteUser(int userId)
          Remove the user id from the list of invited users
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

creatorName

protected java.lang.String creatorName

priv

protected boolean priv

password

protected java.lang.String password

users

protected java.util.Vector users

canvasHistory

protected java.util.Vector canvasHistory

invitedUsers

protected java.util.Vector invitedUsers

bannedUserNames

protected java.util.Vector bannedUserNames
Constructor Detail

BabylonChatRoom

public BabylonChatRoom(java.lang.String n,
                       java.lang.String c,
                       boolean pr,
                       java.lang.String pa)
Method Detail

addUser

protected void addUser(BabylonServerConnection newConnection)
Add a client to this chatroom


removeUser

protected void removeUser(BabylonServerConnection oldConnection)
Remove a client from this chatroom


inviteUser

protected void inviteUser(int userId)
Invite a client to this chatroom


uninviteUser

protected void uninviteUser(int userId)
Remove the user id from the list of invited users


banUserName

protected void banUserName(java.lang.String userName)
Add the user name to the list of banned users.


allowUserName

protected void allowUserName(java.lang.String userName)
Remove the user name from the list of banned users


setLogging

protected void setLogging(boolean onOff)
                   throws java.io.IOException
Turn logging on or off for this chat room

Throws:
java.io.IOException

log

protected void log(java.lang.String logText)
            throws java.io.IOException
Throws:
java.io.IOException

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

Babylon Java Chat