1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java Thu Sep 26 10:43:28 2013 -0700 1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java Fri Oct 04 16:21:34 2013 +0100 1.3 @@ -29,12 +29,20 @@ 1.4 import com.sun.istack.internal.NotNull; 1.5 import com.sun.xml.internal.ws.api.model.ParameterBinding; 1.6 import com.sun.xml.internal.ws.api.model.wsdl.*; 1.7 +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundFault; 1.8 +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation; 1.9 +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType; 1.10 +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage; 1.11 +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; 1.12 +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation; 1.13 +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPart; 1.14 import com.sun.xml.internal.ws.model.RuntimeModeler; 1.15 1.16 import javax.jws.WebParam.Mode; 1.17 import javax.jws.soap.SOAPBinding.Style; 1.18 import javax.xml.namespace.QName; 1.19 import javax.xml.stream.XMLStreamReader; 1.20 + 1.21 import java.util.*; 1.22 1.23 /** 1.24 @@ -42,7 +50,7 @@ 1.25 * 1.26 * @author Vivek Pandey 1.27 */ 1.28 -public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl implements WSDLBoundOperation { 1.29 +public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl implements EditableWSDLBoundOperation { 1.30 private final QName name; 1.31 1.32 // map of wsdl:part to the binding 1.33 @@ -61,20 +69,20 @@ 1.34 private Boolean emptyOutputBody; 1.35 private Boolean emptyFaultBody; 1.36 1.37 - private final Map<String, WSDLPartImpl> inParts; 1.38 - private final Map<String, WSDLPartImpl> outParts; 1.39 - private final List<WSDLBoundFaultImpl> wsdlBoundFaults; 1.40 - private WSDLOperationImpl operation; 1.41 + private final Map<String, EditableWSDLPart> inParts; 1.42 + private final Map<String, EditableWSDLPart> outParts; 1.43 + private final List<EditableWSDLBoundFault> wsdlBoundFaults; 1.44 + private EditableWSDLOperation operation; 1.45 private String soapAction; 1.46 private ANONYMOUS anonymous; 1.47 1.48 - private final WSDLBoundPortTypeImpl owner; 1.49 + private final EditableWSDLBoundPortType owner; 1.50 1.51 /** 1.52 * 1.53 * @param name wsdl:operation name qualified value 1.54 */ 1.55 - public WSDLBoundOperationImpl(XMLStreamReader xsr, WSDLBoundPortTypeImpl owner, QName name) { 1.56 + public WSDLBoundOperationImpl(XMLStreamReader xsr, EditableWSDLBoundPortType owner, QName name) { 1.57 super(xsr); 1.58 this.name = name; 1.59 inputParts = new HashMap<String, ParameterBinding>(); 1.60 @@ -83,9 +91,9 @@ 1.61 inputMimeTypes = new HashMap<String, String>(); 1.62 outputMimeTypes = new HashMap<String, String>(); 1.63 faultMimeTypes = new HashMap<String, String>(); 1.64 - inParts = new HashMap<String, WSDLPartImpl>(); 1.65 - outParts = new HashMap<String, WSDLPartImpl>(); 1.66 - wsdlBoundFaults = new ArrayList<WSDLBoundFaultImpl>(); 1.67 + inParts = new HashMap<String, EditableWSDLPart>(); 1.68 + outParts = new HashMap<String, EditableWSDLPart>(); 1.69 + wsdlBoundFaults = new ArrayList<EditableWSDLBoundFault>(); 1.70 this.owner = owner; 1.71 } 1.72 1.73 @@ -104,7 +112,7 @@ 1.74 } 1.75 1.76 @Override 1.77 - public WSDLPartImpl getPart(String partName, Mode mode) { 1.78 + public EditableWSDLPart getPart(String partName, Mode mode) { 1.79 if(mode==Mode.IN){ 1.80 return inParts.get(partName); 1.81 }else if(mode==Mode.OUT){ 1.82 @@ -113,7 +121,7 @@ 1.83 return null; 1.84 } 1.85 1.86 - public void addPart(WSDLPartImpl part, Mode mode){ 1.87 + public void addPart(EditableWSDLPart part, Mode mode){ 1.88 if(mode==Mode.IN) 1.89 inParts.put(part.getName(), part); 1.90 else if(mode==Mode.OUT) 1.91 @@ -149,54 +157,27 @@ 1.92 1.93 // TODO: what's the difference between this and inputParts/outputParts? 1.94 @Override 1.95 - public Map<String,WSDLPart> getInParts() { 1.96 - return Collections.<String,WSDLPart>unmodifiableMap(inParts); 1.97 + public Map<String, ? extends EditableWSDLPart> getInParts() { 1.98 + return Collections.<String, EditableWSDLPart>unmodifiableMap(inParts); 1.99 } 1.100 1.101 @Override 1.102 - public Map<String,WSDLPart> getOutParts() { 1.103 - return Collections.<String,WSDLPart>unmodifiableMap(outParts); 1.104 + public Map<String, ? extends EditableWSDLPart> getOutParts() { 1.105 + return Collections.<String, EditableWSDLPart>unmodifiableMap(outParts); 1.106 } 1.107 1.108 @NotNull 1.109 @Override 1.110 - public List<WSDLBoundFaultImpl> getFaults() { 1.111 + public List<? extends EditableWSDLBoundFault> getFaults() { 1.112 return wsdlBoundFaults; 1.113 } 1.114 1.115 - public void addFault(@NotNull WSDLBoundFaultImpl fault){ 1.116 + public void addFault(@NotNull EditableWSDLBoundFault fault){ 1.117 wsdlBoundFaults.add(fault); 1.118 } 1.119 1.120 1.121 /** 1.122 - * Map of mime:content@part and the mime type from mime:content@type for wsdl:output 1.123 - * 1.124 - * @return empty Map if there is no parts 1.125 - */ 1.126 - public Map<String, String> getInputMimeTypes() { 1.127 - return inputMimeTypes; 1.128 - } 1.129 - 1.130 - /** 1.131 - * Map of mime:content@part and the mime type from mime:content@type for wsdl:output 1.132 - * 1.133 - * @return empty Map if there is no parts 1.134 - */ 1.135 - public Map<String, String> getOutputMimeTypes() { 1.136 - return outputMimeTypes; 1.137 - } 1.138 - 1.139 - /** 1.140 - * Map of mime:content@part and the mime type from mime:content@type for wsdl:fault 1.141 - * 1.142 - * @return empty Map if there is no parts 1.143 - */ 1.144 - public Map<String, String> getFaultMimeTypes() { 1.145 - return faultMimeTypes; 1.146 - } 1.147 - 1.148 - /** 1.149 * Gets {@link ParameterBinding} for a given wsdl part in wsdl:input 1.150 * 1.151 * @param part Name of wsdl:part, must be non-null 1.152 @@ -296,13 +277,13 @@ 1.153 } 1.154 1.155 @Override 1.156 - public WSDLOperationImpl getOperation() { 1.157 + public EditableWSDLOperation getOperation() { 1.158 return operation; 1.159 } 1.160 1.161 1.162 @Override 1.163 - public WSDLBoundPortType getBoundPortType() { 1.164 + public EditableWSDLBoundPortType getBoundPortType() { 1.165 return owner; 1.166 } 1.167 1.168 @@ -324,7 +305,7 @@ 1.169 } 1.170 1.171 @Override 1.172 - public @Nullable QName getReqPayloadName() { 1.173 + public @Nullable QName getRequestPayloadName() { 1.174 if (emptyRequestPayload) 1.175 return null; 1.176 1.177 @@ -337,8 +318,8 @@ 1.178 return requestPayloadName; 1.179 }else{ 1.180 QName inMsgName = operation.getInput().getMessage().getName(); 1.181 - WSDLMessageImpl message = messages.get(inMsgName); 1.182 - for(WSDLPartImpl part:message.parts()){ 1.183 + EditableWSDLMessage message = messages.get(inMsgName); 1.184 + for(EditableWSDLPart part:message.parts()){ 1.185 ParameterBinding binding = getInputBinding(part.getName()); 1.186 if(binding.isBody()){ 1.187 requestPayloadName = part.getDescriptor().name(); 1.188 @@ -354,7 +335,7 @@ 1.189 } 1.190 1.191 @Override 1.192 - public @Nullable QName getResPayloadName() { 1.193 + public @Nullable QName getResponsePayloadName() { 1.194 if (emptyResponsePayload) 1.195 return null; 1.196 1.197 @@ -367,8 +348,8 @@ 1.198 return responsePayloadName; 1.199 }else{ 1.200 QName outMsgName = operation.getOutput().getMessage().getName(); 1.201 - WSDLMessageImpl message = messages.get(outMsgName); 1.202 - for(WSDLPartImpl part:message.parts()){ 1.203 + EditableWSDLMessage message = messages.get(outMsgName); 1.204 + for(EditableWSDLPart part:message.parts()){ 1.205 ParameterBinding binding = getOutputBinding(part.getName()); 1.206 if(binding.isBody()){ 1.207 responsePayloadName = part.getDescriptor().name(); 1.208 @@ -402,7 +383,6 @@ 1.209 reqNamespace = ns; 1.210 } 1.211 1.212 - 1.213 /** 1.214 * For rpclit gives namespace value on soapbinding:body@namespace 1.215 * 1.216 @@ -418,7 +398,7 @@ 1.217 respNamespace = ns; 1.218 } 1.219 1.220 - WSDLBoundPortTypeImpl getOwner(){ 1.221 + EditableWSDLBoundPortType getOwner(){ 1.222 return owner; 1.223 } 1.224 1.225 @@ -426,12 +406,12 @@ 1.226 private QName responsePayloadName; 1.227 private boolean emptyRequestPayload; 1.228 private boolean emptyResponsePayload; 1.229 - private Map<QName, WSDLMessageImpl> messages; 1.230 + private Map<QName, ? extends EditableWSDLMessage> messages; 1.231 1.232 - void freeze(WSDLModelImpl parent) { 1.233 + public void freeze(EditableWSDLModel parent) { 1.234 messages = parent.getMessages(); 1.235 operation = owner.getPortType().get(name.getLocalPart()); 1.236 - for(WSDLBoundFaultImpl bf : wsdlBoundFaults){ 1.237 + for(EditableWSDLBoundFault bf : wsdlBoundFaults){ 1.238 bf.freeze(this); 1.239 } 1.240 }