KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > wsitconf > ui > service > ProfileUtil


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.websvc.wsitconf.ui.service;
20
21 import javax.swing.JPanel JavaDoc;
22 import org.netbeans.modules.websvc.wsitconf.ui.ComboConstants;
23 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.EndorsingCertificate;
24 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.Generic;
25 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.KerberosAuthentication;
26 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.MessageAuthentication;
27 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.MutualCertificates;
28 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.SAMLAuthorizationOverSSL;
29 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.SAMLHolderOfKey;
30 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.STSIssued;
31 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.STSIssuedCert;
32 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.STSIssuedEndorsing;
33 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.SenderVouches;
34 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.TransportSecurity;
35 import org.netbeans.modules.websvc.wsitconf.ui.service.profiles.UsernameAuthentication;
36 import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
37
38 /**
39  *
40  * @author MartinG
41  */

42 public class ProfileUtil {
43     
44     /** Creates a new instance of ProfileUtil */
45     public ProfileUtil() {
46     }
47
48     public static JPanel JavaDoc getProfilePanel(String JavaDoc profile, WSDLComponent comp) {
49         if (ComboConstants.PROF_GENERIC.equals(profile)) return new Generic(comp);
50         if (ComboConstants.PROF_TRANSPORT.equals(profile)) return new TransportSecurity(comp);
51         if (ComboConstants.PROF_MSGAUTHSSL.equals(profile)) return new MessageAuthentication(comp);
52         if (ComboConstants.PROF_SAMLSSL.equals(profile)) return new SAMLAuthorizationOverSSL(comp);
53         if (ComboConstants.PROF_USERNAME.equals(profile)) return new UsernameAuthentication(comp);
54         if (ComboConstants.PROF_MUTUALCERT.equals(profile)) return new MutualCertificates(comp);
55         if (ComboConstants.PROF_ENDORSCERT.equals(profile)) return new EndorsingCertificate(comp);
56         if (ComboConstants.PROF_SAMLSENDER.equals(profile)) return new SenderVouches(comp);
57         if (ComboConstants.PROF_SAMLHOLDER.equals(profile)) return new SAMLHolderOfKey(comp);
58         if (ComboConstants.PROF_KERBEROS.equals(profile)) return new KerberosAuthentication(comp);
59         if (ComboConstants.PROF_STSISSUED.equals(profile)) return new STSIssued(comp);
60         if (ComboConstants.PROF_STSISSUEDCERT.equals(profile)) return new STSIssuedCert(comp);
61         if (ComboConstants.PROF_STSISSUEDENDORSE.equals(profile)) return new STSIssuedEndorsing(comp);
62         return null;
63     }
64
65     public static String JavaDoc getProfileInfo(String JavaDoc profile) {
66         if (ComboConstants.PROF_GENERIC.equals(profile)) return ComboConstants.PROF_GENERIC_INFO;
67         if (ComboConstants.PROF_TRANSPORT.equals(profile)) return ComboConstants.PROF_TRANSPORT_INFO;
68         if (ComboConstants.PROF_MSGAUTHSSL.equals(profile)) return ComboConstants.PROF_MSGAUTHSSL_INFO;
69         if (ComboConstants.PROF_SAMLSSL.equals(profile)) return ComboConstants.PROF_SAMLSSL_INFO;
70         if (ComboConstants.PROF_USERNAME.equals(profile)) return ComboConstants.PROF_USERNAME_INFO;
71         if (ComboConstants.PROF_MUTUALCERT.equals(profile)) return ComboConstants.PROF_MUTUALCERT_INFO;
72         if (ComboConstants.PROF_ENDORSCERT.equals(profile)) return ComboConstants.PROF_ENDORSCERT_INFO;
73         if (ComboConstants.PROF_SAMLSENDER.equals(profile)) return ComboConstants.PROF_SAMLSENDER_INFO;
74         if (ComboConstants.PROF_SAMLHOLDER.equals(profile)) return ComboConstants.PROF_SAMLHOLDER_INFO;
75         if (ComboConstants.PROF_KERBEROS.equals(profile)) return ComboConstants.PROF_KERBEROS_INFO;
76         if (ComboConstants.PROF_STSISSUED.equals(profile)) return ComboConstants.PROF_STSISSUED_INFO;
77         if (ComboConstants.PROF_STSISSUEDCERT.equals(profile)) return ComboConstants.PROF_STSISSUEDCERT_INFO;
78         if (ComboConstants.PROF_STSISSUEDENDORSE.equals(profile)) return ComboConstants.PROF_STSISSUEDENDORSE_INFO;
79         return null;
80     }
81 }
82
Popular Tags