jChatBox.Service
Class Login

java.lang.Object
  |
  +--jChatBox.Service.Login
Direct Known Subclasses:
SystemLogin, UserLogin

public abstract class Login
extends java.lang.Object

This class defines a generic Login.


Constructor Summary
Login()
           
 
Method Summary
protected  void boundUser(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpSession session, int chatroomID, UserParams uParams, java.lang.String nickname)
          Bounds ChatroomUser, with type = User.NORMAL, to selected chatroom (and his HttpSession).
protected  void boundUser(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpSession session, int chatroomID, UserParams uParams, java.lang.String nickname, int uType)
          Bounds ChatroomUser to selected chatroom (and his HttpSession).
abstract  java.lang.String doLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpSession session)
          Login process.
 java.lang.String getSysMessage()
          Returns message or error.
 void setSysMessage(java.lang.String message)
          Sets message or error.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Login

public Login()
Method Detail

doLogin

public abstract java.lang.String doLogin(javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpSession session)
Login process.
Overide this method to add authentication/authorization.
It must return a "next.jsp" when login succeeded (no exceptions).
It must return null if login fails.


setSysMessage

public void setSysMessage(java.lang.String message)
Sets message or error.


getSysMessage

public java.lang.String getSysMessage()
Returns message or error.


boundUser

protected void boundUser(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpSession session,
                         int chatroomID,
                         UserParams uParams,
                         java.lang.String nickname)
                  throws ChatException
Bounds ChatroomUser, with type = User.NORMAL, to selected chatroom (and his HttpSession).
It also notify users' Monitor.
HTTP parameters from input form will be added to custom parameters (Hashtable) in UserParams.

ChatException

boundUser

protected void boundUser(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpSession session,
                         int chatroomID,
                         UserParams uParams,
                         java.lang.String nickname,
                         int uType)
                  throws ChatException
Bounds ChatroomUser to selected chatroom (and his HttpSession).
It also notify users' Monitor.
HTTP parameters from input form will be added to custom parameters (Hashtable) in UserParams.

ChatException