Package org.apache.beehive.netui.pageflow.handler

Examples of org.apache.beehive.netui.pageflow.handler.LoginHandler


     *
     * @return the current logged-in <code>Principal</code>, or <code>null</code> if there is no logged-in user.
     */
    public Principal getUserPrincipal()
    {
        LoginHandler lh = Handlers.get( getServletContext() ).getLoginHandler();
        return lh.getUserPrincipal(getHandlerContext());
    }
View Full Code Here


     * @return <code>true</code> if there is a current logged-in user and the user is a member of the given role.
     * @see #getUserPrincipal
     */
    public boolean isUserInRole(String roleName)
    {
        LoginHandler lh = Handlers.get( getServletContext() ).getLoginHandler();
        return lh.isUserInRole(getHandlerContext(), roleName);
    }
View Full Code Here

            String actionName = InternalUtils.getActionName( mapping );

            //
            // Check whether isLoginRequired=true for this action.
            //
            LoginHandler loginHandler = Handlers.get( getServletContext() ).getLoginHandler();

            if ( pfActionMapping != null && pfActionMapping.isLoginRequired()
                 && loginHandler.getUserPrincipal( getHandlerContext() ) == null )
            {
                NotLoggedInException ex = createNotLoggedInException( actionName, request );
                return handleException( ex, mapping, form, request, response );
            }
View Full Code Here

        }

        //
        // Here, Struts sends an HTTP error.  We try to let the current page flow handle a relevant exception.
        //
        LoginHandler loginHandler = _handlers.getLoginHandler();
        String actionName = InternalUtils.getActionName( mapping );
        FlowController currentFC = PageFlowRequestWrapper.get( request ).getCurrentFlowController();
        PageFlowException ex;

        if ( loginHandler.getUserPrincipal( context ) == null )
        {
            ex = currentFC.createNotLoggedInException( actionName, request );
        }
        else
        {
View Full Code Here

            String actionName = InternalUtils.getActionName( mapping );

            //
            // Check whether isLoginRequired=true for this action.
            //
            LoginHandler loginHandler = Handlers.get( getServletContext() ).getLoginHandler();

            if ( pfActionMapping != null && pfActionMapping.isLoginRequired()
                 && loginHandler.getUserPrincipal( getHandlerContext() ) == null )
            {
                NotLoggedInException ex = createNotLoggedInException( actionName, request );
                return handleException( ex, mapping, form, request, response );
            }
View Full Code Here

     * @exception LoginException if the authentication failed
     */
    public void login( String username, String password )
        throws LoginException
    {
        LoginHandler lh = Handlers.get( getServletContext() ).getLoginHandler();
        lh.login( getHandlerContext(), username, password );
    }
View Full Code Here

     *            current webapp, set this parameter to <code>false</code> and call
     *            {@link FlowController#getSession}.invalidate().
     */
    public void logout( boolean invalidateSessions )
    {
        LoginHandler lh = Handlers.get( getServletContext() ).getLoginHandler();
        lh.logout( getHandlerContext(), invalidateSessions );
    }
View Full Code Here

     *
     * @return the current logged-in <code>Principal</code>, or <code>null</code> if there is no logged-in user.
     */
    public Principal getUserPrincipal()
    {
        LoginHandler lh = Handlers.get( getServletContext() ).getLoginHandler();
        return lh.getUserPrincipal(getHandlerContext());
    }
View Full Code Here

     * @return <code>true</code> if there is a current logged-in user and the user is a member of the given role.
     * @see #getUserPrincipal
     */
    public boolean isUserInRole(String roleName)
    {
        LoginHandler lh = Handlers.get( getServletContext() ).getLoginHandler();
        return lh.isUserInRole(getHandlerContext(), roleName);
    }
View Full Code Here

        }

        //
        // Here, Struts sends an HTTP error.  We try to let the current page flow handle a relevant exception.
        //
        LoginHandler loginHandler = _handlers.getLoginHandler();
        String actionName = InternalUtils.getActionName( mapping );
        FlowController currentFC = PageFlowRequestWrapper.get( request ).getCurrentFlowController();
        PageFlowException ex;

        if ( loginHandler.getUserPrincipal( context ) == null )
        {
            ex = currentFC.createNotLoggedInException( actionName, request );
        }
        else
        {
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.pageflow.handler.LoginHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.