jChatBox.Chat
Class ChatroomUser

java.lang.Object
  |
  +--jChatBox.Chat.User
        |
        +--jChatBox.Chat.ChatroomUser
All Implemented Interfaces:
java.util.EventListener, javax.servlet.http.HttpSessionBindingListener, java.io.Serializable

public class ChatroomUser
extends User
implements java.io.Serializable, javax.servlet.http.HttpSessionBindingListener

This class implements features to bound/unbound User to HttpSession.

See Also:
Serialized Form

Field Summary
(package private)  LogListener _chatroom
          Chatroom not notify.
(package private)  LogListener _monitor
          Monitor not notify.
 
Fields inherited from class jChatBox.Chat.User
MODERATOR, NORMAL, SYSTEM
 
Constructor Summary
ChatroomUser()
           
ChatroomUser(java.lang.String name, java.lang.String IP, int type, UserParams extra, LogListener chatroom)
          Construct a ChatroomUser from name, email, IP address, type, extra and ChatRoom.
 
Method Summary
 LogListener getChatroomLogListener()
          Returns Chatroom LogListener.
 LogListener getMonitorLogListener()
          Returns Monitor LogListener.
 void updateChatroomLogListener(LogListener newChatroom)
          Updates Chatroom LogListener.
 void updateMonitorLogListener(LogListener newMonitor)
          Updates Monitor LogListener.
 void valueBound(javax.servlet.http.HttpSessionBindingEvent hsbe)
          Interface HttpSessionBindingListenner.
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent hsbe)
          Interface HttpSessionBindingListenner.
 
Methods inherited from class jChatBox.Chat.User
getIP, getName, getParams, getType, setName, setParams, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_chatroom

transient LogListener _chatroom
Chatroom not notify.


_monitor

transient LogListener _monitor
Monitor not notify.

Constructor Detail

ChatroomUser

public ChatroomUser()

ChatroomUser

public ChatroomUser(java.lang.String name,
                    java.lang.String IP,
                    int type,
                    UserParams extra,
                    LogListener chatroom)
Construct a ChatroomUser from name, email, IP address, type, extra and ChatRoom.
We need to know which chatroom the user has joined to send a message when the user logs out.
Message is sent through LogListener.

Method Detail

updateChatroomLogListener

public void updateChatroomLogListener(LogListener newChatroom)
Updates Chatroom LogListener.


updateMonitorLogListener

public void updateMonitorLogListener(LogListener newMonitor)
Updates Monitor LogListener.


getChatroomLogListener

public LogListener getChatroomLogListener()
Returns Chatroom LogListener.


getMonitorLogListener

public LogListener getMonitorLogListener()
Returns Monitor LogListener.


valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent hsbe)
Interface HttpSessionBindingListenner.

Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent hsbe)
Interface HttpSessionBindingListenner.
We notify the chatroom. We also need to notify Monitor bean.

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener