src/share/jaxws_classes/com/sun/xml/internal/ws/api/WSBinding.java

Tue, 09 Apr 2013 14:51:13 +0100

author
alanb
date
Tue, 09 Apr 2013 14:51:13 +0100
changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
permissions
-rw-r--r--

8010393: Update JAX-WS RI to 2.2.9-b12941
Reviewed-by: alanb, erikj
Contributed-by: miroslav.kos@oracle.com, martin.grebac@oracle.com

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

mercurial