|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.ws.api.addressing.WSEndpointReference
public final class WSEndpointReference
Internal representation of the EPR.
Instances of this class are immutable and thread-safe.
AddressingVersion.anonymousEpr| Nested Class Summary | |
|---|---|
static class |
WSEndpointReference.EPRExtension
Represents an extensibility element inside an EndpointReference |
class |
WSEndpointReference.Metadata
Parses the Metadata in an EPR and provides convenience methods to access the metadata. |
(package private) class |
WSEndpointReference.SAXBufferProcessorImpl
Filtering SAXBufferProcessor that replaces the root tag name. |
| Constructor Summary | |
|---|---|
WSEndpointReference(AddressingVersion version,
String address,
QName service,
QName port,
QName portType,
List<Element> metadata,
String wsdlAddress,
List<Element> referenceParameters)
Creates an EPR from individual components. |
|
WSEndpointReference(AddressingVersion version,
String address,
QName service,
QName port,
QName portType,
List<Element> metadata,
String wsdlAddress,
List<Element> referenceParameters,
Collection<WSEndpointReference.EPRExtension> extns,
Map<QName,String> attributes)
Creates an EPR from individual components. |
|
WSEndpointReference(AddressingVersion version,
String address,
QName service,
QName port,
QName portType,
List<Element> metadata,
String wsdlAddress,
String wsdlTargetNamepsace,
List<Element> referenceParameters,
List<Element> elements,
Map<QName,String> attributes)
Creates an EPR from individual components. |
|
WSEndpointReference(EndpointReference epr)
Creates from the spec version of EndpointReference. |
|
WSEndpointReference(EndpointReference epr,
AddressingVersion version)
Creates from the spec version of EndpointReference. |
|
WSEndpointReference(InputStream infoset,
AddressingVersion version)
Creates a WSEndpointReference by parsing an infoset. |
|
WSEndpointReference(String address,
AddressingVersion version)
Creates a WSEndpointReference that only has an address. |
|
WSEndpointReference(URI address,
AddressingVersion version)
|
|
WSEndpointReference(URL address,
AddressingVersion version)
|
|
WSEndpointReference(com.sun.xml.stream.buffer.XMLStreamBuffer infoset,
AddressingVersion version)
Creates a WSEndpointReference that wraps a given infoset. |
|
WSEndpointReference(javax.xml.stream.XMLStreamReader in,
AddressingVersion version)
Creates a WSEndpointReference from the given infoset. |
|
| Method Summary | ||
|---|---|---|
void |
addReferenceParameters(HeaderList headers)
Copies all the reference parameters from the given HeaderList
to this EPR |
|
void |
addReferenceParametersToList(HeaderList outbound)
Copies all the reference parameters in this EPR as headers to the given HeaderList. |
|
Source |
asSource(String localName)
Returns a Source that represents this EPR. |
|
static WSEndpointReference |
create(EndpointReference epr)
Converts from EndpointReference. |
|
|
createDispatch(Service jaxwsService,
Class<T> type,
Service.Mode mode,
WebServiceFeature... features)
Creates a Dispatch that can be used to talk to this EPR. |
|
Dispatch<Object> |
createDispatch(Service jaxwsService,
JAXBContext context,
Service.Mode mode,
WebServiceFeature... features)
Creates a Dispatch that can be used to talk to this EPR. |
|
Header |
createHeader(QName rootTagName)
Returns a Header that wraps this WSEndpointReference. |
|
WSEndpointReference |
createWithAddress(String newAddress)
Creates a new WSEndpointReference by replacing the address of this EPR
to the new one. |
|
WSEndpointReference |
createWithAddress(URI newAddress)
|
|
WSEndpointReference |
createWithAddress(URL newAddress)
|
|
String |
getAddress()
The value of the <wsa:address> header. |
|
WSEndpointReference.EPRExtension |
getEPRExtension(QName extnQName)
Returns the first extensibility element inside EPR root element with input QName. |
|
Collection<WSEndpointReference.EPRExtension> |
getEPRExtensions()
|
|
WSEndpointReference.Metadata |
getMetaData()
Parses the metadata inside this EPR and obtains it in a easy-to-process form. |
|
QName |
getName()
Gets the QName of the EndpointReference element. |
|
|
getPort(Service jaxwsService,
Class<T> serviceEndpointInterface,
WebServiceFeature... features)
Creates a proxy that can be used to talk to this EPR. |
|
AddressingVersion |
getVersion()
Gets the addressing version of this EPR. |
|
boolean |
isAnonymous()
Returns true if this has anonymous URI as the address. |
|
boolean |
isNone()
Returns true if this has none URI
as the address. |
|
javax.xml.stream.XMLStreamReader |
read(String localName)
Reads this EPR as XMLStreamReader. |
|
EndpointReference |
toSpec()
Convert the EPR to the spec version. |
|
|
toSpec(Class<T> clazz)
Converts the EPR to the specified spec version. |
|
String |
toString()
Dumps the EPR infoset in a human-readable string. |
|
void |
writeTo(String localName,
ContentHandler contentHandler,
ErrorHandler errorHandler,
boolean fragment)
Writes this EPR to the given ContentHandler. |
|
void |
writeTo(String localName,
javax.xml.stream.XMLStreamWriter w)
Writes this EPR into the given writer. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WSEndpointReference(EndpointReference epr,
AddressingVersion version)
EndpointReference.
This method performs the data conversion, so it's slow. Do not use this method in a performance critical path.
public WSEndpointReference(EndpointReference epr)
EndpointReference.
This method performs the data conversion, so it's slow. Do not use this method in a performance critical path.
public WSEndpointReference(com.sun.xml.stream.buffer.XMLStreamBuffer infoset,
AddressingVersion version)
WSEndpointReference that wraps a given infoset.
public WSEndpointReference(InputStream infoset,
AddressingVersion version)
throws javax.xml.stream.XMLStreamException
WSEndpointReference by parsing an infoset.
javax.xml.stream.XMLStreamException
public WSEndpointReference(javax.xml.stream.XMLStreamReader in,
AddressingVersion version)
throws javax.xml.stream.XMLStreamException
WSEndpointReference from the given infoset.
The XMLStreamReader must point to either a document or an element.
javax.xml.stream.XMLStreamException
public WSEndpointReference(URL address,
AddressingVersion version)
WSEndpointReference(String, AddressingVersion)
public WSEndpointReference(URI address,
AddressingVersion version)
WSEndpointReference(String, AddressingVersion)
public WSEndpointReference(String address,
AddressingVersion version)
WSEndpointReference that only has an address.
public WSEndpointReference(@NotNull
AddressingVersion version,
@NotNull
String address,
@Nullable
QName service,
@Nullable
QName port,
@Nullable
QName portType,
@Nullable
List<Element> metadata,
@Nullable
String wsdlAddress,
@Nullable
List<Element> referenceParameters)
This version takes various information about metadata, and creates an EPR that has the necessary embedded WSDL.
public WSEndpointReference(@NotNull
AddressingVersion version,
@NotNull
String address,
@Nullable
QName service,
@Nullable
QName port,
@Nullable
QName portType,
@Nullable
List<Element> metadata,
@Nullable
String wsdlAddress,
@Nullable
List<Element> referenceParameters,
@Nullable
Collection<WSEndpointReference.EPRExtension> extns,
@Nullable
Map<QName,String> attributes)
This version takes various information about metadata, and creates an EPR that has the necessary embedded WSDL.
public WSEndpointReference(@NotNull
AddressingVersion version,
@NotNull
String address,
@Nullable
QName service,
@Nullable
QName port,
@Nullable
QName portType,
@Nullable
List<Element> metadata,
@Nullable
String wsdlAddress,
@Nullable
String wsdlTargetNamepsace,
@Nullable
List<Element> referenceParameters,
@Nullable
List<Element> elements,
@Nullable
Map<QName,String> attributes)
This version takes various information about metadata, and creates an EPR that has the necessary embedded WSDL.
| Method Detail |
|---|
@Nullable
public static WSEndpointReference create(@Nullable
EndpointReference epr)
EndpointReference.
This handles null EndpointReference correctly.
Call WSEndpointReference(EndpointReference) directly
if you know it's not null.
@NotNull
public WSEndpointReference createWithAddress(@NotNull
URI newAddress)
createWithAddress(String)
@NotNull
public WSEndpointReference createWithAddress(@NotNull
URL newAddress)
createWithAddress(String)
@NotNull
public WSEndpointReference createWithAddress(@NotNull
String newAddress)
WSEndpointReference by replacing the address of this EPR
to the new one.
The following example shows how you can use this to force an HTTPS EPR, when the endpoint can serve both HTTP and HTTPS requests.
if(epr.getAddress().startsWith("http:"))
epr = epr.createWithAddress("https:"+epr.getAddress().substring(5));
newAddress - This is a complete URL to be written inside <Adress> element of the EPR,
such as "http://foo.bar/abc/def"@NotNull public EndpointReference toSpec()
EndpointReference to be returned depends on which version
of the addressing spec this EPR conforms to.
WebServiceException - if the conversion fails, which can happen if the EPR contains
invalid infoset (wrong namespace URI, etc.)@NotNull public <T extends EndpointReference> T toSpec(Class<T> clazz)
the addressing version in use and
the given class is different, then this may involve version conversion.
@NotNull
public <T> T getPort(@NotNull
Service jaxwsService,
@NotNull
Class<T> serviceEndpointInterface,
WebServiceFeature... features)
All the normal WS-Addressing processing happens automatically,
such as setting the endpoint address to the address,
and sending the reference parameters associated with this EPR as
headers, etc.
@NotNull
public <T> Dispatch<T> createDispatch(@NotNull
Service jaxwsService,
@NotNull
Class<T> type,
@NotNull
Service.Mode mode,
WebServiceFeature... features)
Dispatch that can be used to talk to this EPR.
All the normal WS-Addressing processing happens automatically,
such as setting the endpoint address to the address,
and sending the reference parameters associated with this EPR as
headers, etc.
@NotNull
public Dispatch<Object> createDispatch(@NotNull
Service jaxwsService,
@NotNull
JAXBContext context,
@NotNull
Service.Mode mode,
WebServiceFeature... features)
Dispatch that can be used to talk to this EPR.
All the normal WS-Addressing processing happens automatically,
such as setting the endpoint address to the address,
and sending the reference parameters associated with this EPR as
headers, etc.
@NotNull public AddressingVersion getVersion()
@NotNull public String getAddress()
public boolean isAnonymous()
address.
public boolean isNone()
none URI
as the address.
public javax.xml.stream.XMLStreamReader read(@NotNull
String localName)
throws javax.xml.stream.XMLStreamException
XMLStreamReader.
localName - EPR uses a different root tag name depending on the context.
The returned XMLStreamReader will use the given local name
for the root element name.
javax.xml.stream.XMLStreamException
public Source asSource(@NotNull
String localName)
Source that represents this EPR.
localName - EPR uses a different root tag name depending on the context.
The returned Source will use the given local name
for the root element name.
public void writeTo(@NotNull
String localName,
ContentHandler contentHandler,
ErrorHandler errorHandler,
boolean fragment)
throws SAXException
ContentHandler.
localName - EPR uses a different root tag name depending on the context.
The returned Source will use the given local name
for the root element name.fragment - If true, generate a fragment SAX events without start/endDocument callbacks.
If false, generate a full XML document event.
SAXException
public void writeTo(@NotNull
String localName,
@NotNull
javax.xml.stream.XMLStreamWriter w)
throws javax.xml.stream.XMLStreamException
localName - EPR uses a different root tag name depending on the context.
The returned Source will use the given local name
javax.xml.stream.XMLStreamExceptionpublic Header createHeader(QName rootTagName)
Header that wraps this WSEndpointReference.
The returned header is immutable too, and can be reused with
many Messages.
rootTagName - The header tag name to be used, such as <ReplyTo> or <FaultTo>.
(It's bit ugly that this method takes QName and not just local name,
unlike other methods. If it's making the caller's life miserable, then
we can talk.)public void addReferenceParametersToList(HeaderList outbound)
HeaderList.
public void addReferenceParameters(HeaderList headers)
HeaderList
to this EPR
public String toString()
toString in class Objectpublic QName getName()
getName in interface WSDLExtension
@Nullable
public WSEndpointReference.EPRExtension getEPRExtension(QName extnQName)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
@NotNull
public Collection<WSEndpointReference.EPRExtension> getEPRExtensions()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException@NotNull public WSEndpointReference.Metadata getMetaData()
See WSEndpointReference.Metadata class for what's avaliable as "metadata".
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||