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

Tue, 06 Mar 2012 16:09:35 -0800

author
ohair
date
Tue, 06 Mar 2012 16:09:35 -0800
changeset 286
f50545b5e2f1
child 368
0989ad8c0860
permissions
-rw-r--r--

7150322: Stop using drop source bundles in jaxws
Reviewed-by: darcy, ohrstrom

ohair@286 1 /*
ohair@286 2 * Copyright (c) 1997, 2011, 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
ohair@286 42 /**
ohair@286 43 * JAX-WS implementation of {@link Binding}.
ohair@286 44 *
ohair@286 45 * <p>
ohair@286 46 * This object can be created by {@link BindingID#createBinding()}.
ohair@286 47 *
ohair@286 48 * <p>
ohair@286 49 * Binding conceptually includes the on-the-wire format of the message,
ohair@286 50 * this this object owns {@link Codec}.
ohair@286 51 *
ohair@286 52 * @author Kohsuke Kawaguchi
ohair@286 53 */
ohair@286 54 public interface WSBinding extends Binding {
ohair@286 55 /**
ohair@286 56 * Gets the SOAP version of this binding.
ohair@286 57 *
ohair@286 58 * TODO: clarify what to do with XML/HTTP binding
ohair@286 59 *
ohair@286 60 * <p>
ohair@286 61 * This is just a short-cut for {@code getBindingID().getSOAPVersion()}
ohair@286 62 *
ohair@286 63 * @return
ohair@286 64 * If the binding is using SOAP, this method returns
ohair@286 65 * a {@link SOAPVersion} constant.
ohair@286 66 *
ohair@286 67 * If the binding is not based on SOAP, this method
ohair@286 68 * returns null. See {@link Message} for how a non-SOAP
ohair@286 69 * binding shall be handled by {@link Tube}s.
ohair@286 70 */
ohair@286 71 SOAPVersion getSOAPVersion();
ohair@286 72 /**
ohair@286 73 * Gets the WS-Addressing version of this binding.
ohair@286 74 * <p/>
ohair@286 75 * TODO: clarify what to do with XML/HTTP binding
ohair@286 76 *
ohair@286 77 * @return If the binding is using SOAP and WS-Addressing is enabled,
ohair@286 78 * this method returns a {@link AddressingVersion} constant.
ohair@286 79 * If binding is not using SOAP or WS-Addressing is not enabled,
ohair@286 80 * this method returns null.
ohair@286 81 *
ohair@286 82 * This might be little slow as it has to go over all the features on binding.
ohair@286 83 * Its advisable to cache the addressingVersion wherever possible and reuse it.
ohair@286 84 */
ohair@286 85 AddressingVersion getAddressingVersion();
ohair@286 86
ohair@286 87 /**
ohair@286 88 * Gets the binding ID, which uniquely identifies the binding.
ohair@286 89 *
ohair@286 90 * <p>
ohair@286 91 * The relevant specs define the binding IDs and what they mean.
ohair@286 92 * The ID is used in many places to identify the kind of binding
ohair@286 93 * (such as SOAP1.1, SOAP1.2, REST, ...)
ohair@286 94 *
ohair@286 95 * @return
ohair@286 96 * Always non-null same value.
ohair@286 97 */
ohair@286 98 @NotNull BindingID getBindingId();
ohair@286 99
ohair@286 100 @NotNull List<Handler> getHandlerChain();
ohair@286 101
ohair@286 102 /**
ohair@286 103 * Checks if a particular {@link WebServiceFeature} is enabled.
ohair@286 104 *
ohair@286 105 * @return
ohair@286 106 * true if enabled.
ohair@286 107 */
ohair@286 108 boolean isFeatureEnabled(@NotNull Class<? extends WebServiceFeature> feature);
ohair@286 109
ohair@286 110 /**
ohair@286 111 * Experimental: Checks if a particular {@link WebServiceFeature} on an operation is enabled.
ohair@286 112 *
ohair@286 113 * @param operationName
ohair@286 114 * The WSDL name of the operation.
ohair@286 115 * @return
ohair@286 116 * true if enabled.
ohair@286 117 */
ohair@286 118 boolean isOperationFeatureEnabled(@NotNull Class<? extends WebServiceFeature> feature,
ohair@286 119 @NotNull final QName operationName);
ohair@286 120
ohair@286 121 /**
ohair@286 122 * Gets a {@link WebServiceFeature} of the specific type.
ohair@286 123 *
ohair@286 124 * @param featureType
ohair@286 125 * The type of the feature to retrieve.
ohair@286 126 * @return
ohair@286 127 * If the feature is present and enabled, return a non-null instance.
ohair@286 128 * Otherwise null.
ohair@286 129 */
ohair@286 130 @Nullable <F extends WebServiceFeature> F getFeature(@NotNull Class<F> featureType);
ohair@286 131
ohair@286 132 /**
ohair@286 133 * Experimental: Gets a {@link WebServiceFeature} of the specific type that applies to an operation.
ohair@286 134 *
ohair@286 135 * @param featureType
ohair@286 136 * The type of the feature to retrieve.
ohair@286 137 * @param operationName
ohair@286 138 * The WSDL name of the operation.
ohair@286 139 * @return
ohair@286 140 * If the feature is present and enabled, return a non-null instance.
ohair@286 141 * Otherwise null.
ohair@286 142 */
ohair@286 143 @Nullable <F extends WebServiceFeature> F getOperationFeature(@NotNull Class<F> featureType,
ohair@286 144 @NotNull final QName operationName);
ohair@286 145
ohair@286 146 /**
ohair@286 147 * Returns a list of features associated with {@link WSBinding}.
ohair@286 148 */
ohair@286 149 @NotNull WSFeatureList getFeatures();
ohair@286 150
ohair@286 151 /**
ohair@286 152 * Experimental: Returns a list of features associated with {@link WSBinding} that apply to
ohair@286 153 * a particular operation.
ohair@286 154 *
ohair@286 155 * @param operationName
ohair@286 156 * The WSDL name of the operation.
ohair@286 157 */
ohair@286 158 @NotNull WSFeatureList getOperationFeatures(@NotNull final QName operationName);
ohair@286 159
ohair@286 160 /**
ohair@286 161 * Experimental: Returns a list of features associated with {@link WSBinding} that apply to
ohair@286 162 * the input message of an operation.
ohair@286 163 *
ohair@286 164 * @param operationName
ohair@286 165 * The WSDL name of the operation.
ohair@286 166 */
ohair@286 167 @NotNull WSFeatureList getInputMessageFeatures(@NotNull final QName operationName);
ohair@286 168
ohair@286 169 /**
ohair@286 170 * Experimental: Returns a list of features associated with {@link WSBinding} that apply to
ohair@286 171 * the output message of an operation.
ohair@286 172 *
ohair@286 173 * @param operationName
ohair@286 174 * The WSDL name of the operation.
ohair@286 175 */
ohair@286 176 @NotNull WSFeatureList getOutputMessageFeatures(@NotNull final QName operationName);
ohair@286 177
ohair@286 178 /**
ohair@286 179 * Experimental: Returns a list of features associated with {@link WSBinding} that apply to
ohair@286 180 * one of the fault messages of an operation.
ohair@286 181 *
ohair@286 182 * @param operationName
ohair@286 183 * The WSDL name of the operation.
ohair@286 184 * @param messageName
ohair@286 185 * The WSDL name of the fault message.
ohair@286 186 */
ohair@286 187 @NotNull WSFeatureList getFaultMessageFeatures(@NotNull final QName operationName,
ohair@286 188 @NotNull final QName messageName);
ohair@286 189
ohair@286 190 /**
ohair@286 191 * Returns set of header QNames known to be supported by this binding. Tubes should use this
ohair@286 192 * Set to add QNames for headers they process so that must-understand processing can validate
ohair@286 193 * headers on inbound messages
ohair@286 194 * @return Set of known QNames
ohair@286 195 */
ohair@286 196 @NotNull Set<QName> getKnownHeaders();
ohair@286 197 }

mercurial