KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.util.Calendar JavaDoc;
23 import java.util.Iterator JavaDoc;
24 import java.util.Map JavaDoc;
25
26 import com.sslexplorer.policyframework.AbstractResource;
27
28 /**
29  * Default implementation of an {@link com.sslexplorer.applications.ApplicationShortcut}
30  *
31  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
32  */

33 public class DefaultApplicationShortcut extends AbstractResource implements ApplicationShortcut {
34     
35     // Private instance variables
36

37     private Map JavaDoc<String JavaDoc,String JavaDoc> parameters;
38     private String JavaDoc application;
39
40     /**
41      * Constructor
42      *
43      * @param resourceId resource ID
44      * @param resourceName name
45      * @param resourceDescription description
46      * @param dateCreated date created
47      * @param dateAmended date ameneded
48      * @param application application extension ID
49      * @param parameters shortcut parameters
50      */

51     public DefaultApplicationShortcut(int realmID, int resourceId, String JavaDoc resourceName, String JavaDoc resourceDescription, Calendar JavaDoc dateCreated,
52                     Calendar JavaDoc dateAmended, String JavaDoc application, Map JavaDoc<String JavaDoc,String JavaDoc> parameters) {
53         super(realmID, ApplicationsPlugin.APPLICATION_SHORTCUT_RESOURCE_TYPE, resourceId, resourceName, resourceDescription, dateCreated,
54                         dateAmended);
55         this.application = application;
56         this.parameters = parameters;
57     }
58
59     /* (non-Javadoc)
60      * @see com.sslexplorer.extensions.ApplicationShortcut#getParameters()
61      */

62     public Map JavaDoc<String JavaDoc,String JavaDoc> getParameters() {
63         return parameters;
64     }
65
66     /* (non-Javadoc)
67      * @see com.sslexplorer.extensions.ApplicationShortcut#getApplication()
68      */

69     public String JavaDoc getApplication() {
70         return application;
71     }
72
73
74     public boolean paramsRequirePassword() {
75         Iterator JavaDoc iter = parameters.entrySet().iterator();
76         while (iter.hasNext()) {
77             Map.Entry JavaDoc entry = (Map.Entry JavaDoc) iter.next();
78             if (((String JavaDoc)entry.getValue()).contains("${session:password}")){
79                 return true;
80             }
81         }
82         return false;
83     }
84
85 }
86
Popular Tags