jChatBox.Service
Class UserLogin

java.lang.Object
  |
  +--jChatBox.Service.Login
        |
        +--jChatBox.Service.UserLogin

public class UserLogin
extends Login

This class implements features to login user.


Constructor Summary
UserLogin()
           
 
Method Summary
 java.lang.String doLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpSession session)
          Login ("name" and "chatrooms" fields) from JSP form.
protected  void trace(int level, java.lang.String msg)
          Sends trace to debug.
 
Methods inherited from class jChatBox.Service.Login
boundUser, boundUser, getSysMessage, setSysMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserLogin

public UserLogin()
Method Detail

doLogin

public java.lang.String doLogin(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpSession session)
Login ("name" and "chatrooms" fields) from JSP form.
You can overide this method to implement your own authentification scheme as :
X509 Certificates, LDAP, Database ...
ChatroomUser is logged in once he's attached to its HttpSession.
To do so you have 3 steps to implement :
Step 1 : Get user's info and the chatroom that he wants to log in
String login = request.getParameter("name");
String chatroomIDstr = request.getParameter("chatrooms");
...
...

Step 2 : Do controls (authentication/authorization) and instantiate UserParams
// Your authentication : returns null if it fails.
..
..
UserParams uParams = new UserParams();
uParams.setEmail(email);
...
...

Step 3 : Bound ChatroomUser to chatroom and HttpSession
// Join Chatroom.
try
{
boundUser(request,session,chatroomID,uParams,login);
// Logged.
return Conf.JSPROOM;
} catch (ChatException e)
{
setSysMessage(e.getMessage());
// Fail.
return null;
}

Specified by:
doLogin in class Login

trace

protected void trace(int level,
                     java.lang.String msg)
Sends trace to debug.