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

All Superinterfaces:
Handler

public interface LoginHandler
extends Handler

Handler for login/logout/roles.


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

Method Detail

login

void login(FlowControllerHandlerContext context,
           String username,
           String password)
           throws LoginException
Log in the given user.

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

logout

void logout(FlowControllerHandlerContext context,
            boolean invalidateSessions)
Log out the current user.

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

isUserInRole

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

Parameters:
roleName - the role to check.
Returns:
true if there is a current logged-in user who is in the given role.

getUserPrincipal

Principal getUserPrincipal(FlowControllerHandlerContext context)
Get the current user.

Returns:
a Principal that represents the current logged-in user, or null if there is no logged-in user.