Tue, 06 Mar 2012 16:09:35 -0800
7150322: Stop using drop source bundles in jaxws
Reviewed-by: darcy, ohrstrom
1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
26 package com.sun.xml.internal.ws.api;
28 import com.sun.istack.internal.NotNull;
29 import com.sun.istack.internal.Nullable;
30 import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
31 import com.sun.xml.internal.ws.api.message.Message;
32 import com.sun.xml.internal.ws.api.pipe.Codec;
33 import com.sun.xml.internal.ws.api.pipe.Tube;
35 import javax.xml.namespace.QName;
36 import javax.xml.ws.Binding;
37 import javax.xml.ws.WebServiceFeature;
38 import javax.xml.ws.handler.Handler;
39 import java.util.List;
40 import java.util.Set;
42 /**
43 * JAX-WS implementation of {@link Binding}.
44 *
45 * <p>
46 * This object can be created by {@link BindingID#createBinding()}.
47 *
48 * <p>
49 * Binding conceptually includes the on-the-wire format of the message,
50 * this this object owns {@link Codec}.
51 *
52 * @author Kohsuke Kawaguchi
53 */
54 public interface WSBinding extends Binding {
55 /**
56 * Gets the SOAP version of this binding.
57 *
58 * TODO: clarify what to do with XML/HTTP binding
59 *
60 * <p>
61 * This is just a short-cut for {@code getBindingID().getSOAPVersion()}
62 *
63 * @return
64 * If the binding is using SOAP, this method returns
65 * a {@link SOAPVersion} constant.
66 *
67 * If the binding is not based on SOAP, this method
68 * returns null. See {@link Message} for how a non-SOAP
69 * binding shall be handled by {@link Tube}s.
70 */
71 SOAPVersion getSOAPVersion();
72 /**
73 * Gets the WS-Addressing version of this binding.
74 * <p/>
75 * TODO: clarify what to do with XML/HTTP binding
76 *
77 * @return If the binding is using SOAP and WS-Addressing is enabled,
78 * this method returns a {@link AddressingVersion} constant.
79 * If binding is not using SOAP or WS-Addressing is not enabled,
80 * this method returns null.
81 *
82 * This might be little slow as it has to go over all the features on binding.
83 * Its advisable to cache the addressingVersion wherever possible and reuse it.
84 */
85 AddressingVersion getAddressingVersion();
87 /**
88 * Gets the binding ID, which uniquely identifies the binding.
89 *
90 * <p>
91 * The relevant specs define the binding IDs and what they mean.
92 * The ID is used in many places to identify the kind of binding
93 * (such as SOAP1.1, SOAP1.2, REST, ...)
94 *
95 * @return
96 * Always non-null same value.
97 */
98 @NotNull BindingID getBindingId();
100 @NotNull List<Handler> getHandlerChain();
102 /**
103 * Checks if a particular {@link WebServiceFeature} is enabled.
104 *
105 * @return
106 * true if enabled.
107 */
108 boolean isFeatureEnabled(@NotNull Class<? extends WebServiceFeature> feature);
110 /**
111 * Experimental: Checks if a particular {@link WebServiceFeature} on an operation is enabled.
112 *
113 * @param operationName
114 * The WSDL name of the operation.
115 * @return
116 * true if enabled.
117 */
118 boolean isOperationFeatureEnabled(@NotNull Class<? extends WebServiceFeature> feature,
119 @NotNull final QName operationName);
121 /**
122 * Gets a {@link WebServiceFeature} of the specific type.
123 *
124 * @param featureType
125 * The type of the feature to retrieve.
126 * @return
127 * If the feature is present and enabled, return a non-null instance.
128 * Otherwise null.
129 */
130 @Nullable <F extends WebServiceFeature> F getFeature(@NotNull Class<F> featureType);
132 /**
133 * Experimental: Gets a {@link WebServiceFeature} of the specific type that applies to an operation.
134 *
135 * @param featureType
136 * The type of the feature to retrieve.
137 * @param operationName
138 * The WSDL name of the operation.
139 * @return
140 * If the feature is present and enabled, return a non-null instance.
141 * Otherwise null.
142 */
143 @Nullable <F extends WebServiceFeature> F getOperationFeature(@NotNull Class<F> featureType,
144 @NotNull final QName operationName);
146 /**
147 * Returns a list of features associated with {@link WSBinding}.
148 */
149 @NotNull WSFeatureList getFeatures();
151 /**
152 * Experimental: Returns a list of features associated with {@link WSBinding} that apply to
153 * a particular operation.
154 *
155 * @param operationName
156 * The WSDL name of the operation.
157 */
158 @NotNull WSFeatureList getOperationFeatures(@NotNull final QName operationName);
160 /**
161 * Experimental: Returns a list of features associated with {@link WSBinding} that apply to
162 * the input message of an operation.
163 *
164 * @param operationName
165 * The WSDL name of the operation.
166 */
167 @NotNull WSFeatureList getInputMessageFeatures(@NotNull final QName operationName);
169 /**
170 * Experimental: Returns a list of features associated with {@link WSBinding} that apply to
171 * the output message of an operation.
172 *
173 * @param operationName
174 * The WSDL name of the operation.
175 */
176 @NotNull WSFeatureList getOutputMessageFeatures(@NotNull final QName operationName);
178 /**
179 * Experimental: Returns a list of features associated with {@link WSBinding} that apply to
180 * one of the fault messages of an operation.
181 *
182 * @param operationName
183 * The WSDL name of the operation.
184 * @param messageName
185 * The WSDL name of the fault message.
186 */
187 @NotNull WSFeatureList getFaultMessageFeatures(@NotNull final QName operationName,
188 @NotNull final QName messageName);
190 /**
191 * Returns set of header QNames known to be supported by this binding. Tubes should use this
192 * Set to add QNames for headers they process so that must-understand processing can validate
193 * headers on inbound messages
194 * @return Set of known QNames
195 */
196 @NotNull Set<QName> getKnownHeaders();
197 }