Return-Path: Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 53089 invoked by uid 500); 18 Jul 2003 08:37:17 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 53054 invoked by uid 500); 18 Jul 2003 08:37:16 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 53051 invoked from network); 18 Jul 2003 08:37:16 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 18 Jul 2003 08:37:16 -0000 Received: (qmail 96951 invoked by uid 1260); 18 Jul 2003 08:37:15 -0000 Date: 18 Jul 2003 08:37:15 -0000 Message-ID: <20030718083715.96950.qmail@icarus.apache.org> From: cziegeler@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/acting SessionAction.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N cziegeler 2003/07/18 01:37:15 Modified: src/blocks/session-fw/java/org/apache/cocoon/webapps/session/acting SessionAction.java Log: Cleaning up code, adding javadocs Revision Changes Path 1.3 +21 -5 cocoon-2.1/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/acting/SessionAction.java Index: SessionAction.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/acting/SessionAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SessionAction.java 4 May 2003 20:19:42 -0000 1.2 +++ SessionAction.java 18 Jul 2003 08:37:15 -0000 1.3 @@ -64,6 +64,15 @@ /** * This action creates and terminates a session. + * The action is controlled via parameters. The action parameter defines + * the action (creating or terminating). + * The value "create" creates a new session (if not already available) + * The value "terminate" terminates the session. The termination can be controlled + * with a second parameter "mode": The default value "immediately" terminates + * the session, the value "if-unused" terminates the session only if no + * session context is available anymore. This means the user must not have + * any own session context and must not be authenticated anymore using + * the uthentication framework. * * @author Carsten Ziegeler * @version CVS $Id$ @@ -82,17 +91,24 @@ try { sessionManager = (SessionManager)this.manager.lookup(SessionManager.ROLE); final String action = par.getParameter("action", "create"); - if ( action.equals("create") == true ) { + + if ( action.equals("create") ) { + + // create a session sessionManager.createSession(); - } else if ( action.equals("terminate") == true ) { + + } else if ( action.equals("terminate") ) { + + // terminate a session final String mode = par.getParameter("mode", "immediately"); - if ( mode.equals("immediately") == true) { + if ( mode.equals("immediately") ) { sessionManager.terminateSession(true); - } else if ( mode.equals("if-unused") == true ) { + } else if ( mode.equals("if-unused") ) { sessionManager.terminateSession(false); } else { throw new ProcessingException("Unknown mode " + mode + " for action " + action); } + } else { throw new ProcessingException("Unknown action: " + action); }