KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > applications > ApplicationShortcutDeleteEvent


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.applications;
21
22 import com.sslexplorer.core.CoreAttributeConstants;
23 import com.sslexplorer.extensions.ExtensionDescriptor;
24 import com.sslexplorer.extensions.store.ExtensionStore;
25 import com.sslexplorer.policyframework.ResourceChangeEvent;
26 import com.sslexplorer.policyframework.ResourceDeleteEvent;
27 import com.sslexplorer.security.SessionInfo;
28
29
30 /**
31  * Extension of {@link ResourceChangeEvent} specifically for
32  * {@link ApplicationShortcut} resources.
33  *
34  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
35  */

36 public class ApplicationShortcutDeleteEvent extends ResourceDeleteEvent {
37
38     /**
39      * Constructor.
40      *
41      * @param source source
42      * @param id id
43      * @param session session
44      * @param exception error
45      */

46     public ApplicationShortcutDeleteEvent(Object JavaDoc source, int id, SessionInfo session, Throwable JavaDoc exception) {
47         super(source, id, session, exception);
48     }
49
50     /**
51      * Constructor.
52      *
53      * @param source source
54      * @param id id
55      * @param shortcut client configuration
56      * @param session session
57      * @param state state
58      */

59     public ApplicationShortcutDeleteEvent(Object JavaDoc source, int id, ApplicationShortcut shortcut, SessionInfo session, int state) {
60         super(source, id, shortcut, session, state);
61         if(shortcut != null) {
62             addAttribute(CoreAttributeConstants.EVENT_ATTR_APPLICATION_ID, shortcut.getApplication());
63             try {
64                 ExtensionDescriptor des = ExtensionStore.getInstance().getExtensionDescriptor(shortcut.getApplication());
65                 if(des != null) {
66                     addAttribute(CoreAttributeConstants.EVENT_ATTR_APPLICATION_NAME, des.getName());
67                 }
68             }
69             catch(Exception JavaDoc e) {
70             }
71         }
72     }
73     
74     /**
75      * Get the application shortcut object. This will be <code>null</code>
76      * if the event was constructed for an error.
77      *
78      * @return application shortcut
79      */

80     public ApplicationShortcut getClientConfiguration() {
81         return ((ApplicationShortcut)getResource());
82     }
83
84 }
85
Popular Tags