DJDoc v.1.0.0b-1

net.sf.djdoc.app
Class ContainerBasedUserStrategy

java.lang.Object
  extended by net.sf.djdoc.app.UserStrategy
      extended by net.sf.djdoc.app.ContainerBasedUserStrategy

public class ContainerBasedUserStrategy
extends UserStrategy

This implementation of the UserStrategy class assumes that the servlet container has already authenticated the user and has stored the user's data in a Principal object available to the request.


Constructor Summary
ContainerBasedUserStrategy()
           
 
Method Summary
 User authenticate(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          This implementation of the abstract UserStrategy.authenticate(HttpServletRequest, HttpServletResponse) method retrieves the current user name from the user Principal and looks up the corresponding User object in the database.
 
Methods inherited from class net.sf.djdoc.app.UserStrategy
findUserInDatabase, getStrategy, retrieveUserNameFromCookie, setup, storeUserNameInCookie
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerBasedUserStrategy

public ContainerBasedUserStrategy()
Method Detail

authenticate

public User authenticate(javax.servlet.http.HttpServletRequest req,
                         javax.servlet.http.HttpServletResponse res)
This implementation of the abstract UserStrategy.authenticate(HttpServletRequest, HttpServletResponse) method retrieves the current user name from the user Principal and looks up the corresponding User object in the database.

Specified by:
authenticate in class UserStrategy
Parameters:
req - The current HTTP request object
res - The current HTTP response object
Returns:
An existing (or a new) User object whose name matches that of the user Principal stored in the session.

DJDoc v.1.0.0b-1