KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > security > authwizard > forms > AthenticationSchemeSummaryForm


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.security.authwizard.forms;
21
22 import java.util.ArrayList JavaDoc;
23 import java.util.Iterator JavaDoc;
24 import java.util.List JavaDoc;
25
26 import javax.servlet.http.HttpServletRequest JavaDoc;
27
28 import org.apache.commons.logging.Log;
29 import org.apache.commons.logging.LogFactory;
30
31 import com.sslexplorer.boot.PropertyList;
32 import com.sslexplorer.policyframework.PolicyDatabaseFactory;
33 import com.sslexplorer.security.User;
34 import com.sslexplorer.security.authwizard.actions.AthenticationSchemeSelectionAction;
35 import com.sslexplorer.wizard.AbstractWizardSequence;
36 import com.sslexplorer.wizard.forms.DefaultWizardForm;
37
38 public class AthenticationSchemeSummaryForm extends DefaultWizardForm {
39
40     final static Log log = LogFactory.getLog(AthenticationSchemeSummaryForm.class);
41
42     private User user;
43     private String JavaDoc resourceName;
44     private List JavaDoc selectedPolicies;
45
46     /**
47      * Constructor
48      */

49     public AthenticationSchemeSummaryForm() {
50         super(false, true, "/WEB-INF/jsp/content/security/authwizard/athenticationSchemeSummary.jspf", "", true, true, "athenticationSchemeSummary",
51                         "security", "authwizard.athenticationSchemeSummary", 4);
52     }
53
54     /*
55      * (non-Javadoc)
56      *
57      * @see com.sslexplorer.wizard.forms.AbstractWizardForm#init(com.sslexplorer.wizard.AbstractWizardSequence)
58      */

59     public void init(AbstractWizardSequence sequence, HttpServletRequest JavaDoc request) throws Exception JavaDoc {
60         resourceName = (String JavaDoc) sequence.getAttribute(AthenticationSchemeDetailsForm.ATTR_RESOURCE_NAME, null);
61         PropertyList l = (PropertyList) sequence.getAttribute(AthenticationSchemePolicySelectionForm.ATTR_SELECTED_POLICIES, null);
62         selectedPolicies = new ArrayList JavaDoc();
63         for (Iterator JavaDoc i = l.iterator(); i.hasNext();) {
64             selectedPolicies.add(PolicyDatabaseFactory.getInstance().getPolicy(Integer.parseInt(i.next().toString()))
65                             .getResourceName());
66         }
67         user = (User) sequence.getAttribute(AthenticationSchemeSelectionAction.ATTR_USER, null);
68     }
69
70     /**
71      * @return Returns the name.
72      */

73     public String JavaDoc getResourceName() {
74         return resourceName;
75     }
76
77     /**
78      * @return Returns the selectedPolicies.
79      */

80     public List JavaDoc getSelectedPolicies() {
81         return selectedPolicies;
82     }
83
84     /**
85      * @return Returns the user.
86      */

87     public User getUser() {
88         return user;
89     }
90 }
91
Popular Tags