KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > tunnels > actions > LaunchTunnelAction


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.tunnels.actions;
21
22 import com.sslexplorer.boot.Util;
23 import com.sslexplorer.policyframework.LaunchSession;
24 import com.sslexplorer.policyframework.Resource;
25 import com.sslexplorer.policyframework.actions.AbstractRedirectLaunchAction;
26 import com.sslexplorer.security.SessionInfo;
27 import com.sslexplorer.tunnels.TunnelPlugin;
28
29 /**
30  * Implementation of {@link com.sslexplorer.core.actions.AuthenticatedAction}
31  * that launches a <i>Network Place</i>.
32  * <p>
33  *
34  *
35  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
36  */

37 public class LaunchTunnelAction extends AbstractRedirectLaunchAction {
38
39     /**
40      * Constructor.
41      */

42     public LaunchTunnelAction() {
43         super(TunnelPlugin.SSL_TUNNEL_RESOURCE_TYPE, SessionInfo.MANAGEMENT_CONSOLE_CONTEXT | SessionInfo.USER_CONSOLE_CONTEXT);
44     }
45
46     /*
47      * (non-Javadoc)
48      *
49      * @see com.sslexplorer.policyframework.actions.AbstractRedirectLaunchAction#doPrepareLink(com.sslexplorer.policyframework.LaunchSession,
50      * java.lang.String)
51      */

52     protected String JavaDoc doPrepareLink(LaunchSession launchSession, String JavaDoc returnTo) {
53         return "startTunnel.do?launchId=" + launchSession.getId() + "&returnTo=" + Util.urlEncode(returnTo);
54     }
55
56     /*
57      * (non-Javadoc)
58      *
59      * @see com.sslexplorer.policyframework.actions.AbstractLaunchAction#isAgentRequired(com.sslexplorer.policyframework.Resource)
60      */

61     protected boolean isAgentRequired(Resource resource) {
62         return true;
63     }
64
65     /*
66      * (non-Javadoc)
67      *
68      * @see com.sslexplorer.policyframework.actions.AbstractRedirectLaunchAction#isDirectLink(com.sslexplorer.policyframework.LaunchSession)
69      */

70     protected boolean isDirectLink(LaunchSession launchSession) {
71         return true;
72     }
73 }
74
Popular Tags