org.riotfamily.riot.security.session
Class LoginManager

java.lang.Object
  extended by org.riotfamily.riot.security.session.LoginManager
All Implemented Interfaces:
ServletContextAware

public class LoginManager
extends Object
implements ServletContextAware


Constructor Summary
LoginManager(AuthenticationService authenticationService)
           
 
Method Summary
static LoginManager getInstance(ServletContext servletContext)
          Returns the LoginManager for the given ServletContext.
static SessionMetaData getSessionMetaData(HttpServletRequest request)
          Returns the SessionData for the given request.
protected  RiotUser getUser(HttpServletRequest request)
          Returns the user associated with the given request.
 boolean login(HttpServletRequest request, String userName, String password)
          Tries to authenticate the user with the given credentials.
static void logout(HttpServletRequest request, HttpServletResponse response)
          Performs a logout by invalidating the session.
 void setMetaDataStore(SessionMetaDataStore metaDataStore)
           
 void setServletContext(ServletContext servletContext)
          Stores a reference to itself in the ServletContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginManager

public LoginManager(AuthenticationService authenticationService)
Method Detail

setMetaDataStore

public void setMetaDataStore(SessionMetaDataStore metaDataStore)

setServletContext

public void setServletContext(ServletContext servletContext)
Stores a reference to itself in the ServletContext.

Specified by:
setServletContext in interface ServletContextAware
See Also:
ServletContextAware

getInstance

public static LoginManager getInstance(ServletContext servletContext)
Returns the LoginManager for the given ServletContext.


login

public boolean login(HttpServletRequest request,
                     String userName,
                     String password)
Tries to authenticate the user with the given credentials. If the authentication succeeds the RiotUser is stored in the HTTP session.


logout

public static void logout(HttpServletRequest request,
                          HttpServletResponse response)
Performs a logout by invalidating the session.


getUser

protected RiotUser getUser(HttpServletRequest request)
Returns the user associated with the given request.


getSessionMetaData

public static SessionMetaData getSessionMetaData(HttpServletRequest request)
Returns the SessionData for the given request.