com.sun.xml.ws.model.wsdl
Class WSDLBoundPortTypeImpl

java.lang.Object
  extended by com.sun.xml.ws.model.wsdl.WSDLBoundPortTypeImpl
All Implemented Interfaces:
EditableWSDLBoundPortType, WSDLBoundPortType, WSDLExtensible, WSDLFeaturedObject, WSDLObject

public final class WSDLBoundPortTypeImpl
extends Object
implements EditableWSDLBoundPortType

Implementation of WSDLBoundPortType

Author:
Vivek Pandey

Nested Class Summary
protected static class com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension
           
 
Field Summary
protected  Set<WSDLExtension> extensions
           
protected  WebServiceFeatureList features
           
protected  List<com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension> notUnderstoodExtensions
           
 
Constructor Summary
WSDLBoundPortTypeImpl(XMLStreamReader xsr, EditableWSDLModel owner, QName name, QName portTypeName)
           
 
Method Summary
 void addExtension(WSDLExtension ex)
          Adds a new WSDLExtension to this object.
 void addFeature(WebServiceFeature feature)
          Enables a WebServiceFeature based upon policy assertions on this port.
 void addNotUnderstoodExtension(QName extnEl, Locator locator)
          This can be used if a WSDL extension element that has wsdl:required=true is not understood
 boolean areRequiredExtensionsUnderstood()
          This method should be called after freezing the WSDLModel
 void freeze()
          Freezes WSDL model to prevent further modification
 EditableWSDLBoundOperation get(QName operationName)
          Gets the WSDLBoundOperation for a given operation name
 ParameterBinding getBinding(QName operation, String part, WebParam.Mode mode)
          Gets the ParameterBinding for a given operation, part name and the direction - IN/OUT
 BindingID getBindingId()
          Returns the binding ID.
 Iterable<EditableWSDLBoundOperation> getBindingOperations()
          Gets the WSDLBoundOperations
<T extends WSDLExtension>
T
getExtension(Class<T> type)
          Gets the extension that is assignable to the given type.
 Iterable<WSDLExtension> getExtensions()
          Gets all the WSDLExtensions added through WSDLExtensible.addExtension(WSDLExtension).
<T extends WSDLExtension>
Iterable<T>
getExtensions(Class<T> type)
          Gets all the extensions that is assignable to the given type.
<F extends WebServiceFeature>
F
getFeature(Class<F> featureType)
           
 WebServiceFeature getFeature(String id)
           
 WebServiceFeatureList getFeatures()
          Gets the feature list associated with this object.
 Locator getLocation()
          Gets the source location information in the parsed WSDL.
 QName getName()
          Gets the name of the wsdl:binding@name attribute value as local name and wsdl:definitions@targetNamespace as the namespace uri.
 List<? extends com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension> getNotUnderstoodExtensions()
          Lists extensions marked as not understood
 EditableWSDLBoundOperation getOperation(String namespaceUri, String localName)
          Gets the bound operation in this port for a tag name.
 EditableWSDLModel getOwner()
          Gets the WSDLModel that owns this port type.
 EditableWSDLPortType getPortType()
          Gets the WSDLPortType associated with the wsdl:binding
 QName getPortTypeName()
          Gets the wsdl:binding@type value, same as WSDLPortType.getName()
 SOAPBinding.Style getStyle()
          Is this a document style or RPC style? Since we only support literal and not encoding, this means either doc/lit or rpc/lit.
 boolean isDoclit()
           
 boolean isRpcLit()
           
 void put(QName opName, EditableWSDLBoundOperation ptOp)
          Populates the Map that holds operation name as key and WSDLBoundOperation as the value.
 void setBindingId(BindingID bindingId)
          Sets the binding ID
 void setStyle(SOAPBinding.Style style)
          sets whether the WSDLBoundPortType is rpc or lit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.xml.ws.api.model.wsdl.WSDLFeaturedObject
addFeature, getFeature, getFeatures
 
Methods inherited from interface com.sun.xml.ws.api.model.wsdl.WSDLExtensible
addExtension, addNotUnderstoodExtension, areRequiredExtensionsUnderstood, getExtension, getExtensions, getExtensions, getNotUnderstoodExtensions
 
Methods inherited from interface com.sun.xml.ws.api.model.wsdl.WSDLObject
getLocation
 

Field Detail

features

protected WebServiceFeatureList features

extensions

protected final Set<WSDLExtension> extensions

notUnderstoodExtensions

protected List<com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension> notUnderstoodExtensions
Constructor Detail

WSDLBoundPortTypeImpl

public WSDLBoundPortTypeImpl(XMLStreamReader xsr,
                             @NotNull
                             EditableWSDLModel owner,
                             QName name,
                             QName portTypeName)
Method Detail

getName

public QName getName()
Description copied from interface: WSDLBoundPortType
Gets the name of the wsdl:binding@name attribute value as local name and wsdl:definitions@targetNamespace as the namespace uri.

Specified by:
getName in interface WSDLBoundPortType

getOwner

@NotNull
public EditableWSDLModel getOwner()
Description copied from interface: WSDLBoundPortType
Gets the WSDLModel that owns this port type.

Specified by:
getOwner in interface EditableWSDLBoundPortType
Specified by:
getOwner in interface WSDLBoundPortType

get

public EditableWSDLBoundOperation get(QName operationName)
Description copied from interface: WSDLBoundPortType
Gets the WSDLBoundOperation for a given operation name

Specified by:
get in interface EditableWSDLBoundPortType
Specified by:
get in interface WSDLBoundPortType
Parameters:
operationName - non-null operationName
Returns:
null if a WSDLBoundOperation is not found

put

public void put(QName opName,
                EditableWSDLBoundOperation ptOp)
Populates the Map that holds operation name as key and WSDLBoundOperation as the value.

Specified by:
put in interface EditableWSDLBoundPortType
Parameters:
opName - Must be non-null
ptOp - Must be non-null
Throws:
NullPointerException - if either opName or ptOp is null

getPortTypeName

public QName getPortTypeName()
Description copied from interface: WSDLBoundPortType
Gets the wsdl:binding@type value, same as WSDLPortType.getName()

Specified by:
getPortTypeName in interface WSDLBoundPortType

getPortType

public EditableWSDLPortType getPortType()
Description copied from interface: WSDLBoundPortType
Gets the WSDLPortType associated with the wsdl:binding

Specified by:
getPortType in interface EditableWSDLBoundPortType
Specified by:
getPortType in interface WSDLBoundPortType

getBindingOperations

public Iterable<EditableWSDLBoundOperation> getBindingOperations()
Description copied from interface: WSDLBoundPortType
Gets the WSDLBoundOperations

Specified by:
getBindingOperations in interface EditableWSDLBoundPortType
Specified by:
getBindingOperations in interface WSDLBoundPortType

getBindingId

public BindingID getBindingId()
Description copied from interface: WSDLBoundPortType
Returns the binding ID. This would typically determined by the binding extension elements in wsdl:binding.

Specified by:
getBindingId in interface WSDLBoundPortType

setBindingId

public void setBindingId(BindingID bindingId)
Description copied from interface: EditableWSDLBoundPortType
Sets the binding ID

Specified by:
setBindingId in interface EditableWSDLBoundPortType
Parameters:
bindingId - Binding ID

setStyle

public void setStyle(SOAPBinding.Style style)
Description copied from interface: EditableWSDLBoundPortType
sets whether the WSDLBoundPortType is rpc or lit

Specified by:
setStyle in interface EditableWSDLBoundPortType

getStyle

public SOAPBinding.Style getStyle()
Description copied from interface: WSDLBoundPortType
Is this a document style or RPC style? Since we only support literal and not encoding, this means either doc/lit or rpc/lit.

Specified by:
getStyle in interface WSDLBoundPortType

isRpcLit

public boolean isRpcLit()

isDoclit

public boolean isDoclit()

getBinding

public ParameterBinding getBinding(QName operation,
                                   String part,
                                   WebParam.Mode mode)
Gets the ParameterBinding for a given operation, part name and the direction - IN/OUT

Specified by:
getBinding in interface WSDLBoundPortType
Parameters:
operation - wsdl:operation@name value. Must be non-null.
part - wsdl:part@name such as value of soap:header@part. Must be non-null.
mode - WebParam.Mode.IN or WebParam.Mode.OUT. Must be non-null.
Returns:
null if the binding could not be resolved for the part.

getOperation

public EditableWSDLBoundOperation getOperation(String namespaceUri,
                                               String localName)
Description copied from interface: WSDLBoundPortType
Gets the bound operation in this port for a tag name. Here the operation would be the one whose input part descriptor bound to soap:body is same as the tag name except for rpclit where the tag name would be WSDLBoundOperation.getName().

If you have a Message and trying to figure out which operation it belongs to, always use Message.getOperation(com.sun.xml.ws.api.model.wsdl.WSDLBoundPortType), as that performs better.

For example this can be used in the case when a message receipient can get the WSDLBoundOperation from the payload tag name.

namespaceUri and the local name both can be null to get the WSDLBoundOperation that has empty body - there is no payload. According to BP 1.1 in a port there can be at MOST one operation with empty body. Its an error to have namespace URI non-null but local name as null.

Specified by:
getOperation in interface EditableWSDLBoundPortType
Specified by:
getOperation in interface WSDLBoundPortType
Parameters:
namespaceUri - namespace of the payload element.
localName - local name of the payload
Returns:
null if no operation with the given tag name is found.

freeze

public void freeze()
Description copied from interface: EditableWSDLBoundPortType
Freezes WSDL model to prevent further modification

Specified by:
freeze in interface EditableWSDLBoundPortType

addFeature

public final void addFeature(WebServiceFeature feature)
Description copied from interface: WSDLFeaturedObject
Enables a WebServiceFeature based upon policy assertions on this port. This method would be called during WSDL parsing by WS-Policy code.

Specified by:
addFeature in interface WSDLFeaturedObject

getFeatures

@NotNull
public WebServiceFeatureList getFeatures()
Description copied from interface: WSDLFeaturedObject
Gets the feature list associated with this object.

Specified by:
getFeatures in interface WSDLFeaturedObject

getFeature

public final WebServiceFeature getFeature(String id)

getFeature

@Nullable
public <F extends WebServiceFeature> F getFeature(@NotNull
                                                           Class<F> featureType)
Specified by:
getFeature in interface WSDLFeaturedObject

getExtensions

public final Iterable<WSDLExtension> getExtensions()
Description copied from interface: WSDLExtensible
Gets all the WSDLExtensions added through WSDLExtensible.addExtension(WSDLExtension).

Specified by:
getExtensions in interface WSDLExtensible
Returns:
never null.

getExtensions

public final <T extends WSDLExtension> Iterable<T> getExtensions(Class<T> type)
Description copied from interface: WSDLExtensible
Gets all the extensions that is assignable to the given type.

This allows clients to find specific extensions in a type-safe and convenient way.

Specified by:
getExtensions in interface WSDLExtensible
Parameters:
type - The type of the extension to obtain. Must not be null.
Returns:
Can be an empty fromjava.collection but never null.

getExtension

public <T extends WSDLExtension> T getExtension(Class<T> type)
Description copied from interface: WSDLExtensible
Gets the extension that is assignable to the given type.

This is just a convenient version that does

 Iterator itr = getExtensions(type);
 if(itr.hasNext())  return itr.next();
 else               return null;
 

Specified by:
getExtension in interface WSDLExtensible
Returns:
null if the extension was not found.

addExtension

public void addExtension(WSDLExtension ex)
Description copied from interface: WSDLExtensible
Adds a new WSDLExtension to this object.

Specified by:
addExtension in interface WSDLExtensible
Parameters:
ex - must not be null.

getNotUnderstoodExtensions

public List<? extends com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension> getNotUnderstoodExtensions()
Description copied from interface: WSDLExtensible
Lists extensions marked as not understood

Specified by:
getNotUnderstoodExtensions in interface WSDLExtensible
Returns:
List of not understood extensions

addNotUnderstoodExtension

public void addNotUnderstoodExtension(QName extnEl,
                                      Locator locator)
This can be used if a WSDL extension element that has wsdl:required=true is not understood

Specified by:
addNotUnderstoodExtension in interface WSDLExtensible
Parameters:
extnEl -
locator -

areRequiredExtensionsUnderstood

public boolean areRequiredExtensionsUnderstood()
This method should be called after freezing the WSDLModel

Specified by:
areRequiredExtensionsUnderstood in interface WSDLExtensible
Returns:
true if all wsdl required extensions on Port and Binding are understood

getLocation

@NotNull
public final Locator getLocation()
Description copied from interface: WSDLObject
Gets the source location information in the parsed WSDL. This is useful when producing error messages.

Specified by:
getLocation in interface WSDLObject


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.