KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > dd > api > services > MessageSecurityProvider


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.j2ee.sun.dd.api.services;
20
21 import java.io.File JavaDoc;
22
23 import org.netbeans.modules.j2ee.sun.dd.api.common.MessageSecurityBinding;
24
25
26 /** Service interface that defines capabilities for third party modules to manipulate
27  * the security bindings present in the SJSAS server specific deployment descriptors.
28  *
29  * @author Peter Williams
30  */

31 public interface MessageSecurityProvider {
32     
33     /* Retrieve current MessageSecurityBinding data for the specified endpoint
34      *
35      * @param sunDD File reference to the primary sun deployment descriptor file for this
36      * j2ee/javaEE module.
37      * @param endpointName Value from the webservice-description-name field in webservices.xml
38      * or equivalent annotation for the pertinent webservice endpoint.
39      * @param portName Value from the port-component-name field in webservices.xml or
40      * equivalent annotation for the pertinent port-component of the endpoint.
41      *
42      * @return Copy of the MessageSecurityBinding data for the specified endpoint or null
43      * if the endpoint cannot be located, or if there is not currently any binding information.
44      *
45      * @throws IllegalArgumentException if sunDD does not refer to the proper descriptor file
46      * or if either the endpointName or portName fields are empty (null or "").
47      * @throws IllegalStateException if the SJSAS configuration has not been initialized.
48      * This could occur if SJSAS is not the current selected server for the project.
49      *
50      * FIXME How to differentiate the errors "service not found", "port not found", and
51      * "no binding" from each other? Currently implementation does not distinguish them.
52      */

53     public MessageSecurityBinding getEndpointBinding(File JavaDoc sunDD, String JavaDoc endpointName, String JavaDoc portName);
54
55     
56     /* Set new MessageSecurityBinding data for the specified endpoint.
57      *
58      * - If the configuration file is not open in an editor in any form, this new data will
59      * be merged and saved.
60      * - If the configuration file is open in the XML view, an attempt will be made to merge
61      * the graphs. If the file was previously unchanged, it will remain so and the new data
62      * will be saved. If there were unsaved changes, the file will remain dirty and the changes
63      * will not be saved. If the merge fails, the user will be notified of the problem. The
64      * security settings may need to be fixed manually if this happens.
65      * - If the configuration file is open in the GUI view, the data will be merged and the
66      * editor will be marked dirty. If the user subsequently closes the file without saving
67      * the changes will be lost.
68      *
69      * @param sunDD File reference to the primary sun deployment descriptor file for this
70      * j2ee/javaEE module.
71      * @param endpointName Value from the webservice-description-name field in webservices.xml
72      * or equivalent annotation for the pertinent webservice endpoint.
73      * @param portName Value from the port-component-name field in webservices.xml or
74      * equivalent annotation for the pertinent port-component of the endpoint.
75      * @param binding Binding data to save.
76      *
77      * @returns true if succcessful, false on failure.
78      *
79      * @throws IllegalArgumentException if sunDD does not refer to the proper descriptor file
80      * or if either the endpointName or portName fields are empty (null or "") or if there is
81      * no defined endpoint with the specified portName.
82      * @throws IllegalStateException if the SJSAS configuration has not been initialized.
83      * This could occur if SJSAS is not the current selected server for the project.
84      */

85     public boolean setEndpointBinding(File JavaDoc sunDD, String JavaDoc endpointName, String JavaDoc portName, MessageSecurityBinding binding);
86
87
88     /* Retrieve current MessageSecurityBinding data for the specified webservice client.
89      *
90      * NOTE: Temporarily, this API does not allow the user to specify which port they
91      * want the binding for. If the client defines multiple ports, then only the first
92      * MessageSecurityBinding will be returned. Be sure to note corollary in set method.
93      *
94      * @param sunDD File reference to the primary sun deployment descriptor file for this
95      * j2ee/javaEE module.
96      * @param serviceRefName Value from the service-ref-name field in sun-web.xml, sun-ejb-jar.xml,
97      * sun-application-client.xml, or equivalent annotation for the pertinent webservice client.
98      *
99      * FIXME How to differentiate the errors "service ref found", and "no binding" from each
100      * other? Currently implementation does not distinguish them.
101      *
102      * @deprecated
103      */

104     public MessageSecurityBinding getServiceRefBinding(File JavaDoc sunDD, String JavaDoc serviceRefName);
105     
106     
107     /* Retrieve current MessageSecurityBinding data for the specified wsdl-port (determined
108      * by the namespaceURI and localpart fields) of the specified webservice client.
109      *
110      * @param sunDD File reference to the primary sun deployment descriptor file for this
111      * j2ee/javaEE module.
112      * @param serviceRefName Value from the service-ref-name field in sun-web.xml, sun-ejb-jar.xml,
113      * sun-application-client.xml, or equivalent annotation for the pertinent webservice client.
114      * @param namespaceURI namespace URI designation for the wsdl-port this binding will be associated
115      * with. This is typically the target namespace, but depends on the WSDL file. This parameter
116      * cannot be null or empty.
117      * @param localpart name of the wsdl-port as specified in the WSDL file under the service
118      * entry. This parameter cannot be null or empty.
119      *
120      * @throws IllegalArgumentException if sunDD does not refer to the proper descriptor file
121      * or if the serviceRefName, namespaceURI, or localpart fields are empty (null or "").
122      * @throws IllegalStateException if the SJSAS configuration has not been initialized.
123      * This could occur if SJSAS is not the current selected server for the project.
124      *
125      * FIXME How to differentiate the errors "service ref found", "wsdl-port" not found, and
126      * "no binding" from each other? Currently implementation does not distinguish them.
127      */

128     public MessageSecurityBinding getServiceRefBinding(File JavaDoc sunDD, String JavaDoc serviceRefName,
129             String JavaDoc namespaceURI, String JavaDoc localpart);
130     
131     
132     /* Set the MessageSecurityBinding data for the specified webservice client. The
133      * current implementation applies this binding data to all configured ports on this
134      * client.
135      *
136      * Note that the binding instance passed in is cloned for all ports it is configured to
137      * so subsequent modification of that instance after this call returns will not affect
138      * the data that was configured by this call. A subsequent call to setServiceRefBinding()
139      * would be required to apply new binding data.
140      *
141      * @param sunDD File reference to the primary sun deployment descriptor file for this
142      * j2ee/javaEE module.
143      * @param serviceRefName Value from the service-ref-name field in sun-web.xml, sun-ejb-jar.xml,
144      * sun-application-client.xml, or equivalent annotation for the pertinent webservice client.
145      * @param binding The MessageSecurityBinding data to apply to all ports.
146      *
147      * @returns true if succcessful, false on failure.
148      *
149      * @deprecated
150      */

151     public boolean setServiceRefBinding(File JavaDoc sunDD, String JavaDoc serviceRefName, MessageSecurityBinding binding);
152
153     
154     /* Set the MessageSecurityBinding data for the specified wsdl-port (determined
155      * by the namespaceURI and localpart fields) of the specified webservice client.
156      * If a matching wsdl-port is not found, a new one will be created and initialized
157      * with the binding data.
158      *
159      * Note that the binding instance passed in is cloned so subsequent modification of
160      * that instance after this call returns will not affect the data that was configured
161      * by this call. A subsequent call to setServiceRefBinding() would be required to
162      * apply new binding data.
163      *
164      * @param sunDD File reference to the primary sun deployment descriptor file for this
165      * j2ee/javaEE module.
166      * @param serviceRefName Value from the service-ref-name field in sun-web.xml, sun-ejb-jar.xml,
167      * sun-application-client.xml, or equivalent annotation for the pertinent webservice client.
168      * @param namespaceURI namespace URI designation for the wsdl-port this binding will be associated
169      * with. This is typically the target namespace, but depends on the WSDL file. This parameter
170      * cannot be null or empty.
171      * @param localpart name of the wsdl-port as specified in the WSDL file under the service
172      * entry. This parameter cannot be null or empty.
173      * @param binding The MessageSecurityBinding data to apply to all ports.
174      *
175      * @returns true if succcessful, false on failure.
176      *
177      * @throws IllegalArgumentException if sunDD does not refer to the proper descriptor file
178      * or if the serviceRefName, namespaceURI, or localpart fields are empty (null or "").
179      * @throws IllegalStateException if the SJSAS configuration has not been initialized.
180      * This could occur if SJSAS is not the current selected server for the project.
181      */

182     public boolean setServiceRefBinding(File JavaDoc sunDD, String JavaDoc serviceRefName, String JavaDoc namespaceURI,
183             String JavaDoc localpart, MessageSecurityBinding binding);
184
185         
186     /* Creates a new MessageSecurityBinding instance appropriate for the sun
187      * deployment descriptor specified. Requires that Sun Deployment Configuration
188      * subsystem be initialized for this project, which implies that SJSAS is
189      * the current selected server.
190      *
191      * @param sunDD File refering to the primary sun deployment descriptor. The
192      * actual configuration file does not have to exist.
193      *
194      * @return a new empty instance of a MessageSecurityBinding object versioned for the
195      * current configuration.
196      *
197      * @throws IllegalArgumentException if sunDD does not refer to the proper descriptor file.
198      * @throws IllegalStateException if the configuration has not been initialized
199      * yet. This can happen if the selected server for the project is not SJSAS.
200      */

201     public MessageSecurityBinding newMessageSecurityBinding(File JavaDoc sunDD);
202     
203
204 }
205
Popular Tags