org.melati.login
Class HttpSessionAccessHandler

Package class diagram package HttpSessionAccessHandler
java.lang.Object
  extended by org.melati.login.HttpSessionAccessHandler
All Implemented Interfaces:
AccessHandler

public class HttpSessionAccessHandler
extends Object
implements AccessHandler

An AccessHandler which uses Session cookies to elicit and maintain the user's login and password.


Field Summary
static String OVERLAY_PARAMETERS
          Class name.
static String USER
          Class name.
 
Constructor Summary
HttpSessionAccessHandler()
           
 
Method Summary
 void buildRequest(Melati melati)
          If we are returning from a login rebuild the original request, otherwise do nothing.
 Melati establishUser(Melati melati)
          Set the Access token to be used for this request.
 void handleAccessException(Melati melati, AccessPoemException accessException)
          Store the current request and redirect to the login page.
protected  String loginPageServletClassName()
          The class name of the class implementing the login servlet.
 String loginPageURL(Melati melati, javax.servlet.http.HttpServletRequest request)
          The URL of the login servlet.
protected  void logUsIn(Melati melati, User user)
          Set our AccessToken.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OVERLAY_PARAMETERS

public static final String OVERLAY_PARAMETERS
Class name.

See Also:
Constant Field Values

USER

public static final String USER
Class name.

See Also:
Constant Field Values
Constructor Detail

HttpSessionAccessHandler

public HttpSessionAccessHandler()
Method Detail

loginPageServletClassName

protected String loginPageServletClassName()
The class name of the class implementing the login servlet. Unless overridden, this is org.melati.login.Login.

Returns:
the class name of login servlet
See Also:
Login

loginPageURL

public String loginPageURL(Melati melati,
                           javax.servlet.http.HttpServletRequest request)
The URL of the login servlet. Unless overridden, this is computed by substituting loginPageServletClassName() into the URL of the request being serviced.

Parameters:
melati - the current Melati
request - the request currently being serviced
Returns:
the login page url
See Also:
loginPageServletClassName()

handleAccessException

public void handleAccessException(Melati melati,
                                  AccessPoemException accessException)
                           throws Exception
Store the current request and redirect to the login page. Deal with an AccessPoemException, often by allowing login.

Specified by:
handleAccessException in interface AccessHandler
Parameters:
melati - current Melati
accessException - the AccessException
Throws:
Exception
See Also:
AccessHandler.handleAccessException(org.melati.Melati, org.melati.poem.AccessPoemException)

establishUser

public Melati establishUser(Melati melati)
Set the Access token to be used for this request. The Access Token is either picked up from the session, or from a cookie. The cookie is keyed on the logical database and is used to retrieve the user's login. The login is used (with the logical database name) to retrieve an encoded password which is then checked. Called when a @link PoemTask} is initiated.

Specified by:
establishUser in interface AccessHandler
Returns:
A Melati with the appropriate fields filled.
See Also:
AccessHandler.establishUser(org.melati.Melati)

logUsIn

protected void logUsIn(Melati melati,
                       User user)
Set our AccessToken. NOTE Remember a User isa Token.

Parameters:
melati - the Melati to get our database from
user - the token to set

buildRequest

public void buildRequest(Melati melati)
                  throws ReconstructedHttpServletRequestMismatchException
If we are returning from a login rebuild the original request, otherwise do nothing. Rebuild request if we have had to login, otherwise nothing.

Specified by:
buildRequest in interface AccessHandler
Parameters:
melati - used to hold original request
Throws:
ReconstructedHttpServletRequestMismatchException
See Also:
AccessHandler.buildRequest(org.melati.Melati)


Copyright © 2000-2010 PanEris. All Rights Reserved.