Package org.apache.cocoon.webapps.session.components

Examples of org.apache.cocoon.webapps.session.components.SessionManager


     */
    public Map act (Redirector redirector, SourceResolver resolver, Map objectModel, String src,
            Parameters parameters) throws Exception {
        Request req = ObjectModelHelper.getRequest(objectModel);

        SessionManager sessionManager = null;
        // read local settings
        try {

            sessionManager = (SessionManager)this.manager.lookup(SessionManager.ROLE);
            Session session = sessionManager.getSession(true);

            Configuration conf = (Configuration)session.getAttribute(
                                  req.getParameter(SessionConstants.SESSION_FORM_PARAMETER));

            String valstr = parameters.getParameter ("validate", (String) settings.get("validate",""));
View Full Code Here


                   SourceResolver resolver,
                   Map objectModel,
                   String source,
                   Parameters par)
    throws ProcessingException {
        SessionManager sessionManager = null;
        try {
            sessionManager = (SessionManager)this.manager.lookup(SessionManager.ROLE);
            final String action = par.getParameter("action", "create");
            if ( action.equals("create") == true ) {
                sessionManager.createSession();
            } else if ( action.equals("terminate") == true ) {
                final String mode = par.getParameter("mode", "immediately");
                if ( mode.equals("immediately") == true) {
                    sessionManager.terminateSession(true);
                } else if ( mode.equals("if-unused") == true ) {
                    sessionManager.terminateSession(false);
                } else {
                    throw new ProcessingException("Unknown mode " + mode + " for action " + action);
                }
            } else {
                throw new ProcessingException("Unknown action: " + action);
View Full Code Here

            UserState status = this.getUserState();
            status.removeHandler( handlerName );
            this.updateUserState();

            // handling of session termination
            SessionManager sessionManager = null;
            try {
                sessionManager = (SessionManager)this.manager.lookup( SessionManager.ROLE );
           
                if ( mode == AuthenticationConstants.LOGOUT_MODE_IMMEDIATELY ) {
                    sessionManager.terminateSession(true);
                } else if ( mode == AuthenticationConstants.LOGOUT_MODE_IF_UNUSED ) {
                    if ( !status.hasHandler()) {
                        sessionManager.terminateSession( false );
                    }
                
                } else if ( mode == AuthenticationConstants.LOGOUT_MODE_IF_NOT_AUTHENTICATED) {
                    if ( !status.hasHandler()) {
                        sessionManager.terminateSession( true );
                    }
                } else {
                    throw new ProcessingException("Unknown logout mode: " + mode);
                }
           
View Full Code Here

            } else {
                authenticationFragment.appendChild(doc.importNode(data, true));
            }
           
            // now set this information in the temporary context
            SessionManager sessionManager = null;
            try {
                sessionManager = (SessionManager) this.manager.lookup( SessionManager.ROLE );
                SessionContext temp = sessionManager.getContext( SessionConstants.TEMPORARY_CONTEXT );
                temp.appendXML("/", authenticationFragment);
            } catch ( ServiceException se ) {
                throw new ProcessingException("Unable to lookup session manager.", se);
            } finally {
                this.manager.release( sessionManager );
View Full Code Here

TOP

Related Classes of org.apache.cocoon.webapps.session.components.SessionManager

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.