org.apache.beehive.netui.pageflow.handler
Interface LoginHandler

All Superinterfaces:
Handler
All Known Implementing Classes:
DefaultLoginHandler

public interface LoginHandler
extends Handler

Handler for login/logout/roles/


Method Summary
 Principal getUserPrincipal(HttpServletRequest request)
          Get the current user.
 boolean isUserInRole(String roleName, HttpServletRequest request)
          Tell whether the current user is in a given role.
 void login(String username, String password, HttpServletRequest request, HttpServletResponse response)
          Log in the given user.
 void logout(boolean invalidateSessions, HttpServletRequest request, HttpServletResponse response)
          Log out the current user.
 
Methods inherited from interface Handler
init, reinit
 

Method Detail

login

void login(String username,
           String password,
           HttpServletRequest request,
           HttpServletResponse response)
           throws LoginException
Log in the given user.

Parameters:
username - the user to log in.
password - the user's password.
request - the current HttpServletRequest.
Throws:
LoginException - if the login fails.

logout

void logout(boolean invalidateSessions,
            HttpServletRequest request,
            HttpServletResponse response)
Log out the current user.

Parameters:
invalidateSessions - if true, current sessions associated with the current logged-in user will be invalidated.
request - the current HttpServletRequest.

isUserInRole

boolean isUserInRole(String roleName,
                     HttpServletRequest request)
Tell whether the current user is in a given role.

Parameters:
roleName - the role to check.
request - the current HttpServletRequest.
Returns:
true if the current logged-in user is in the given role.

getUserPrincipal

Principal getUserPrincipal(HttpServletRequest request)
Get the current user.

Parameters:
request - the current HttpServletRequest.
Returns:
a Principal that represents the current logged-in user.