1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/api/WSBinding.java Tue Mar 06 16:09:35 2012 -0800 1.3 @@ -0,0 +1,197 @@ 1.4 +/* 1.5 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 + 1.29 +package com.sun.xml.internal.ws.api; 1.30 + 1.31 +import com.sun.istack.internal.NotNull; 1.32 +import com.sun.istack.internal.Nullable; 1.33 +import com.sun.xml.internal.ws.api.addressing.AddressingVersion; 1.34 +import com.sun.xml.internal.ws.api.message.Message; 1.35 +import com.sun.xml.internal.ws.api.pipe.Codec; 1.36 +import com.sun.xml.internal.ws.api.pipe.Tube; 1.37 + 1.38 +import javax.xml.namespace.QName; 1.39 +import javax.xml.ws.Binding; 1.40 +import javax.xml.ws.WebServiceFeature; 1.41 +import javax.xml.ws.handler.Handler; 1.42 +import java.util.List; 1.43 +import java.util.Set; 1.44 + 1.45 +/** 1.46 + * JAX-WS implementation of {@link Binding}. 1.47 + * 1.48 + * <p> 1.49 + * This object can be created by {@link BindingID#createBinding()}. 1.50 + * 1.51 + * <p> 1.52 + * Binding conceptually includes the on-the-wire format of the message, 1.53 + * this this object owns {@link Codec}. 1.54 + * 1.55 + * @author Kohsuke Kawaguchi 1.56 + */ 1.57 +public interface WSBinding extends Binding { 1.58 + /** 1.59 + * Gets the SOAP version of this binding. 1.60 + * 1.61 + * TODO: clarify what to do with XML/HTTP binding 1.62 + * 1.63 + * <p> 1.64 + * This is just a short-cut for {@code getBindingID().getSOAPVersion()} 1.65 + * 1.66 + * @return 1.67 + * If the binding is using SOAP, this method returns 1.68 + * a {@link SOAPVersion} constant. 1.69 + * 1.70 + * If the binding is not based on SOAP, this method 1.71 + * returns null. See {@link Message} for how a non-SOAP 1.72 + * binding shall be handled by {@link Tube}s. 1.73 + */ 1.74 + SOAPVersion getSOAPVersion(); 1.75 + /** 1.76 + * Gets the WS-Addressing version of this binding. 1.77 + * <p/> 1.78 + * TODO: clarify what to do with XML/HTTP binding 1.79 + * 1.80 + * @return If the binding is using SOAP and WS-Addressing is enabled, 1.81 + * this method returns a {@link AddressingVersion} constant. 1.82 + * If binding is not using SOAP or WS-Addressing is not enabled, 1.83 + * this method returns null. 1.84 + * 1.85 + * This might be little slow as it has to go over all the features on binding. 1.86 + * Its advisable to cache the addressingVersion wherever possible and reuse it. 1.87 + */ 1.88 + AddressingVersion getAddressingVersion(); 1.89 + 1.90 + /** 1.91 + * Gets the binding ID, which uniquely identifies the binding. 1.92 + * 1.93 + * <p> 1.94 + * The relevant specs define the binding IDs and what they mean. 1.95 + * The ID is used in many places to identify the kind of binding 1.96 + * (such as SOAP1.1, SOAP1.2, REST, ...) 1.97 + * 1.98 + * @return 1.99 + * Always non-null same value. 1.100 + */ 1.101 + @NotNull BindingID getBindingId(); 1.102 + 1.103 + @NotNull List<Handler> getHandlerChain(); 1.104 + 1.105 + /** 1.106 + * Checks if a particular {@link WebServiceFeature} is enabled. 1.107 + * 1.108 + * @return 1.109 + * true if enabled. 1.110 + */ 1.111 + boolean isFeatureEnabled(@NotNull Class<? extends WebServiceFeature> feature); 1.112 + 1.113 + /** 1.114 + * Experimental: Checks if a particular {@link WebServiceFeature} on an operation is enabled. 1.115 + * 1.116 + * @param operationName 1.117 + * The WSDL name of the operation. 1.118 + * @return 1.119 + * true if enabled. 1.120 + */ 1.121 + boolean isOperationFeatureEnabled(@NotNull Class<? extends WebServiceFeature> feature, 1.122 + @NotNull final QName operationName); 1.123 + 1.124 + /** 1.125 + * Gets a {@link WebServiceFeature} of the specific type. 1.126 + * 1.127 + * @param featureType 1.128 + * The type of the feature to retrieve. 1.129 + * @return 1.130 + * If the feature is present and enabled, return a non-null instance. 1.131 + * Otherwise null. 1.132 + */ 1.133 + @Nullable <F extends WebServiceFeature> F getFeature(@NotNull Class<F> featureType); 1.134 + 1.135 + /** 1.136 + * Experimental: Gets a {@link WebServiceFeature} of the specific type that applies to an operation. 1.137 + * 1.138 + * @param featureType 1.139 + * The type of the feature to retrieve. 1.140 + * @param operationName 1.141 + * The WSDL name of the operation. 1.142 + * @return 1.143 + * If the feature is present and enabled, return a non-null instance. 1.144 + * Otherwise null. 1.145 + */ 1.146 + @Nullable <F extends WebServiceFeature> F getOperationFeature(@NotNull Class<F> featureType, 1.147 + @NotNull final QName operationName); 1.148 + 1.149 + /** 1.150 + * Returns a list of features associated with {@link WSBinding}. 1.151 + */ 1.152 + @NotNull WSFeatureList getFeatures(); 1.153 + 1.154 + /** 1.155 + * Experimental: Returns a list of features associated with {@link WSBinding} that apply to 1.156 + * a particular operation. 1.157 + * 1.158 + * @param operationName 1.159 + * The WSDL name of the operation. 1.160 + */ 1.161 + @NotNull WSFeatureList getOperationFeatures(@NotNull final QName operationName); 1.162 + 1.163 + /** 1.164 + * Experimental: Returns a list of features associated with {@link WSBinding} that apply to 1.165 + * the input message of an operation. 1.166 + * 1.167 + * @param operationName 1.168 + * The WSDL name of the operation. 1.169 + */ 1.170 + @NotNull WSFeatureList getInputMessageFeatures(@NotNull final QName operationName); 1.171 + 1.172 + /** 1.173 + * Experimental: Returns a list of features associated with {@link WSBinding} that apply to 1.174 + * the output message of an operation. 1.175 + * 1.176 + * @param operationName 1.177 + * The WSDL name of the operation. 1.178 + */ 1.179 + @NotNull WSFeatureList getOutputMessageFeatures(@NotNull final QName operationName); 1.180 + 1.181 + /** 1.182 + * Experimental: Returns a list of features associated with {@link WSBinding} that apply to 1.183 + * one of the fault messages of an operation. 1.184 + * 1.185 + * @param operationName 1.186 + * The WSDL name of the operation. 1.187 + * @param messageName 1.188 + * The WSDL name of the fault message. 1.189 + */ 1.190 + @NotNull WSFeatureList getFaultMessageFeatures(@NotNull final QName operationName, 1.191 + @NotNull final QName messageName); 1.192 + 1.193 + /** 1.194 + * Returns set of header QNames known to be supported by this binding. Tubes should use this 1.195 + * Set to add QNames for headers they process so that must-understand processing can validate 1.196 + * headers on inbound messages 1.197 + * @return Set of known QNames 1.198 + */ 1.199 + @NotNull Set<QName> getKnownHeaders(); 1.200 +}