org.systinet.wasp.addressing
Class EndpointReference

java.lang.Object
  extended byorg.systinet.wasp.addressing.EndpointReference
All Implemented Interfaces:
java.lang.Cloneable, DomainExpression, java.io.Serializable

public class EndpointReference
extends java.lang.Object
implements DomainExpression, java.io.Serializable, java.lang.Cloneable

WS-Addressing EndpointReference structure implementation.

Endpoint reference conveys the information needed to identify/reference a web service endpoint. It can be used to address individual messages sent between web service and a client.

Since:
5.0
See Also:
Serialized Form
Component:
Core

Field Summary
static java.lang.String ANONYMOUS
          A special value of the address field for endpoint references with no stable accessible address (i.e.
 
Constructor Summary
EndpointReference()
          Creates a new endpoint reference with an ANONYMOUS address.
EndpointReference(ServiceClient client)
          Creates a new endpoint reference from given ServiceClient.
EndpointReference(javax.xml.transform.Source source)
          Creates a new endpoint reference from given Source.
EndpointReference(java.lang.String address)
          Creates a new endpoint reference with a given address.
EndpointReference(java.lang.String address, QName portType, QName serviceName, java.lang.String portName)
          Creates a new endpoint reference with a given address, portType, service and port.
 
Method Summary
 java.lang.Object clone()
           
static java.lang.String computeAddressingURI()
          Compute addressing uri from default policy
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAddress()
          Gets the endpoint reference address.
 javax.xml.transform.Source getContent()
          Gets content of this object as an instance of Source.
 java.lang.String getPortName()
          Gets the port name or null.
 QName getPortType()
          Gets the port type or null.
 ReferenceProperties getReferenceProperties()
          Get ReferenceProperties for this EndpointReference.
 QName getServiceName()
          Gets the service name or null.
 int hashCode()
           
 boolean includes(DomainExpression domainExpression)
          Returns true if this domain expression includes the given one.
 boolean isAnonymous()
          Returns true if the address of this endpoint reference is ANONYMOUS.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANONYMOUS

public static final java.lang.String ANONYMOUS
A special value of the address field for endpoint references with no stable accessible address (i.e. the response channel of the HTTP connection). This value is specified in WS-Addressing specification (2003/3). The value for anonymous role changes from WS-Addressing specification version to version, however value of this constant remains the same to preserve backward-compatibility. To check if this EndpointReference is anonymous, use isAnonymous() method.

See Also:
Constant Field Values
Constructor Detail

EndpointReference

public EndpointReference()
Creates a new endpoint reference with an ANONYMOUS address.


EndpointReference

public EndpointReference(java.lang.String address)
Creates a new endpoint reference with a given address.

Parameters:
address - the URL address of this endpoint reference

EndpointReference

public EndpointReference(java.lang.String address,
                         QName portType,
                         QName serviceName,
                         java.lang.String portName)
Creates a new endpoint reference with a given address, portType, service and port. Some of the parameters can be null. Note that null address is not the same as ANONYMOUS address.


EndpointReference

public EndpointReference(ServiceClient client)
                  throws LookupException
Creates a new endpoint reference from given ServiceClient.

Parameters:
client - the service client
Throws:
LookupException - when a lookup is performed during obtaining WSDL port name and service name for passed ServiceClient

EndpointReference

public EndpointReference(javax.xml.transform.Source source)
                  throws PolicyException
Creates a new endpoint reference from given Source. Load this EndpointReference from Source. Only for Policy usage as a DomainExpression: Note that ReferenceProperties must be in EndpointReference.NS_URI namespace, which is currently string from old spec. so it cannot be loaded from a source got from an EndpointReference from a wire, because it could probably be in a newer namespace (WS-Addressing versus WS-Policy namespace collision)

Parameters:
source - the source
Throws:
PolicyException - when an error occurs during the loading
Method Detail

getAddress

public java.lang.String getAddress()
Gets the endpoint reference address.

Returns:
address

getPortType

public QName getPortType()
Gets the port type or null.

Returns:
port type

getServiceName

public QName getServiceName()
Gets the service name or null.

Returns:
service name

getPortName

public java.lang.String getPortName()
Gets the port name or null.

Returns:
port name

isAnonymous

public boolean isAnonymous()
Returns true if the address of this endpoint reference is ANONYMOUS.

Returns:
true if the address is ANONYMOUS.

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()

includes

public boolean includes(DomainExpression domainExpression)
Returns true if this domain expression includes the given one. There are in following cases:
  • domainExpression equals this
  • domainExpression is instance of EndpointReference and:

Specified by:
includes in interface DomainExpression
Parameters:
domainExpression -
Returns:
true if this domain expression includes the given one; false otherwise.

getContent

public javax.xml.transform.Source getContent()
                                      throws PolicyException
Gets content of this object as an instance of Source. Namespace for ReferenceProperties must be in EndpointReference.NS_URI namespace, see #load(javax.xml.transform.Source)

Specified by:
getContent in interface DomainExpression
Returns:
content of this object as an instance of Source
Throws:
PolicyException

computeAddressingURI

public static java.lang.String computeAddressingURI()
                                             throws PolicyException
Compute addressing uri from default policy

Returns:
Throws:
PolicyException

toString

public java.lang.String toString()

getReferenceProperties

public ReferenceProperties getReferenceProperties()
                                           throws SOAPException
Get ReferenceProperties for this EndpointReference. Can be empty if not set (but not null)

Throws:
SOAPException

clone

public java.lang.Object clone()