KickJava   Java API By Example, From Geeks To Geeks.

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


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 javax.servlet.http.HttpServletRequest JavaDoc;
23 import javax.servlet.http.HttpServletResponse JavaDoc;
24
25 import org.apache.commons.logging.Log;
26 import org.apache.commons.logging.LogFactory;
27 import org.apache.struts.Globals;
28 import org.apache.struts.action.ActionForm;
29 import org.apache.struts.action.ActionForward;
30 import org.apache.struts.action.ActionMapping;
31 import org.apache.struts.action.ActionMessage;
32 import org.apache.struts.action.ActionMessages;
33
34 import com.sslexplorer.policyframework.Resource;
35 import com.sslexplorer.policyframework.actions.AbstractResourceDispatchAction;
36 import com.sslexplorer.security.SessionInfo;
37 import com.sslexplorer.tunnels.TunnelPlugin;
38
39 /**
40  * Implementation of
41  * {@link com.sslexplorer.policyframework.actions.AbstractResourceDispatchAction}
42  * that handles the updating of <i>SSL Tunnels</i>. These work slightly
43  * differently to the other SSL-Explorer resources as communication occurs with
44  * the VPN client.
45  *
46  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
47  * @author James D Robinson <a HREF="mailto:james@3sp.com">&lt;james@3sp.com&gt;</a>
48  * @author Lee David Painter <a HREF="mailto:lee@3sp.com">&lt;lee@3sp.com&gt;</a>
49  */

50 public class EditTunnelAction extends AbstractResourceDispatchAction {
51
52     static Log log = LogFactory.getLog(EditTunnelAction.class);
53
54     /**
55      * Constructor
56      */

57     public EditTunnelAction() {
58         super(TunnelPlugin.SSL_TUNNEL_RESOURCE_TYPE);
59     }
60
61     /*
62      * (non-Javadoc)
63      *
64      * @see com.sslexplorer.policyframework.actions.AbstractResourceDispatchAction#edit(org.apache.struts.action.ActionMapping,
65      * org.apache.struts.action.ActionForm,
66      * javax.servlet.http.HttpServletRequest,
67      * javax.servlet.http.HttpServletResponse)
68      */

69     public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response)
70                     throws Exception JavaDoc {
71         return super.edit(mapping, form, request, response);
72     }
73
74     /*
75      * (non-Javadoc)
76      *
77      * @see com.sslexplorer.core.actions.CoreAction#getNavigationContext(org.apache.struts.action.ActionMapping,
78      * org.apache.struts.action.ActionForm,
79      * javax.servlet.http.HttpServletRequest,
80      * javax.servlet.http.HttpServletResponse)
81      */

82     public int getNavigationContext(ActionMapping mapping, ActionForm form, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
83         return SessionInfo.MANAGEMENT_CONSOLE_CONTEXT | SessionInfo.USER_CONSOLE_CONTEXT;
84     }
85
86     /*
87      * (non-Javadoc)
88      *
89      * @see com.sslexplorer.policyframework.actions.AbstractResourceDispatchAction#createResource(org.apache.struts.action.ActionMapping,
90      * org.apache.struts.action.ActionForm,
91      * javax.servlet.http.HttpServletRequest,
92      * javax.servlet.http.HttpServletResponse)
93      */

94     public Resource createResource(ActionMapping mapping, ActionForm form, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response)
95                     throws Exception JavaDoc {
96         return null;
97     }
98
99     /* (non-Javadoc)
100      * @see com.sslexplorer.policyframework.actions.AbstractResourceDispatchAction#commit(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
101      */

102     public ActionForward commit(ActionMapping mapping, ActionForm form, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response)
103                     throws Exception JavaDoc {
104         ActionMessages msgs = new ActionMessages();
105         msgs.add(Globals.MESSAGE_KEY, new ActionMessage("editTunnel.message.saved"));
106         this.addMessages(request, msgs);
107         return super.commit(mapping, form, request, response);
108     }
109 }
Popular Tags