KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > wsitconf > wsdlmodelext > RequiredConfigurationHelper


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
20 package org.netbeans.modules.websvc.wsitconf.wsdlmodelext;
21
22 import org.netbeans.modules.websvc.wsitmodelext.security.tokens.ProtectionToken;
23 import org.netbeans.modules.websvc.wsitmodelext.security.tokens.SecureConversationToken;
24 import org.netbeans.modules.xml.wsdl.model.*;
25
26 /**
27  *
28  * @author Martin Grebac
29  */

30 public class RequiredConfigurationHelper {
31     
32     /**
33      * @param c One of Binding, Operation
34      * @param glassfish
35      * @param jsr109
36      * @param cbHandlerType One of usernameHandler, kerberosHandler, samlHandler, passwordHandler
37      * @return Returns true if configuration of callbackhandler cbHandlerType is required for component
38      */

39     public static boolean isCallbackHandlerRequired(
40             WSDLComponent c, boolean glassfish, boolean jsr109, String JavaDoc cbHandlerType) {
41         return true;
42     }
43
44     /**
45      * @param c One of Binding, Operation
46      * @param glassfish
47      * @param jsr109
48      * @param validatorType One of usernameValidator, timestampValidator, certificateValidator, samlValidator
49      * @return Returns true if configuration of validator validatorType is required for component
50      */

51     public static boolean isValidatorRequired(
52             WSDLComponent c, boolean glassfish, boolean jsr109, String JavaDoc validatorType) {
53         return true;
54     }
55     
56     public static boolean isKeystoreRequired(
57             WSDLComponent c, boolean client, boolean glassfish, boolean jsr109) {
58         return true;
59     }
60
61     public static boolean isTruststoreRequired(
62             WSDLComponent c, boolean client, boolean glassfish, boolean jsr109) {
63         return true;
64     }
65     
66     public static boolean isSecureConversationParamRequired(
67             WSDLComponent c) {
68
69         boolean secConvEnabled = false;
70         
71         if (SecurityPolicyModelHelper.isSecurityEnabled(c)) {
72             WSDLComponent secBinding = SecurityPolicyModelHelper.getSecurityBindingTypeElement(c);
73             WSDLComponent tokenKind = SecurityTokensModelHelper.getTokenElement(secBinding, ProtectionToken.class);
74             WSDLComponent tokenType = SecurityTokensModelHelper.getTokenTypeElement(tokenKind);
75             secConvEnabled = (tokenType instanceof SecureConversationToken);
76         }
77         
78         return secConvEnabled;
79     }
80
81 }
82
Popular Tags