org.apache.beehive.netui.pageflow.internal
Class DefaultLoginHandler
Object
BaseHandler
DefaultHandler
DefaultLoginHandler
- All Implemented Interfaces:
- Serializable, Handler, LoginHandler
public class DefaultLoginHandler
- extends DefaultHandler
- implements LoginHandler
Implements default J2EE web-tier login handling.
- See Also:
- Serialized Form
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultLoginHandler
public DefaultLoginHandler(ServletContext servletContext)
login
public void login(FlowControllerHandlerContext context,
String username,
String password)
throws LoginException
- Description copied from interface:
LoginHandler
- Log in the given user.
- Specified by:
login in interface LoginHandler
username - the user to log in.password - the user's password.
- Throws:
LoginException - if the login fails.
logout
public void logout(FlowControllerHandlerContext context,
boolean invalidateSessions)
- Description copied from interface:
LoginHandler
- Log out the current user.
- Specified by:
logout in interface LoginHandler
invalidateSessions - if true, current sessions associated with the current
logged-in user will be invalidated.
isUserInRole
public boolean isUserInRole(FlowControllerHandlerContext context,
String roleName)
- Description copied from interface:
LoginHandler
- Tell whether the current user is in a given role.
- Specified by:
isUserInRole in interface LoginHandler
roleName - the role to check.
- Returns:
true if there is a current logged-in user who is in the given role.
getUserPrincipal
public Principal getUserPrincipal(FlowControllerHandlerContext context)
- Description copied from interface:
LoginHandler
- Get the current user.
- Specified by:
getUserPrincipal in interface LoginHandler
- Returns:
- a
Principal that represents the current logged-in user, or null if there is no
logged-in user.