edu.utexas.beg.agi.servlet
Class LoginHandler

java.lang.Object
  |
  +--edu.utexas.beg.agi.servlet.LoginHandler

public class LoginHandler
extends Object

A helper Object for the AGIServlet, for handling user logins.

This class has two main functions, to determine if an HTTP request is a login attempt, and to actually perform a login if it is.


Constructor Summary
LoginHandler()
           
 
Method Summary
 void handleLogin(javax.servlet.http.HttpServletRequest request)
          Processes a login request.
 boolean isLoginRequest(javax.servlet.http.HttpServletRequest request)
          Determines if an HTTP request is a request for login.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

LoginHandler

public LoginHandler()
Method Detail

isLoginRequest

public boolean isLoginRequest(javax.servlet.http.HttpServletRequest request)
Determines if an HTTP request is a request for login.

This method is called for every request that comes to the AGIServlet. If it is deemed a "login request", then handleLogin() will be called, otherwise it as processed normally by the AGIServlet.

Parameters:
request - the HTTP GET or POST request received from the client browser.
Returns:
true if this is a login request, false if not.

handleLogin

public void handleLogin(javax.servlet.http.HttpServletRequest request)
Processes a login request.

If the login is validated and successful, then this method should create and initialize a Session Object for this user. (The Session Object will be attached to the Request Object.)

Parameters:
request - the HTTP GET or POST request for login.
Throws:
IllegalArgumentException - if the user could not be logged in.