You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2013/07/12 17:42:50 UTC
svn commit: r1502591 - in /cxf/trunk:
api/src/main/java/org/apache/cxf/ws/addressing/
rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/
rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/
Author: dkulp
Date: Fri Jul 12 15:42:49 2013
New Revision: 1502591
URL: http://svn.apache.org/r1502591
Log:
Make the AddressingProperties a concrete class to make it easier to work with
Removed:
cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingBuilder.java
cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingType.java
cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingBuilderImpl.java
cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/AddressingBuilderImplTest.java
cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/AddressingBuilderTest.java
Modified:
cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingConstants.java
cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingProperties.java
cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingConstantsImpl.java
cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingPropertiesImpl.java
Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingConstants.java?rev=1502591&r1=1502590&r2=1502591&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingConstants.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingConstants.java Fri Jul 12 15:42:49 2013
@@ -20,163 +20,235 @@
package org.apache.cxf.ws.addressing;
+import java.util.ResourceBundle;
+
import javax.xml.namespace.QName;
+import org.apache.cxf.common.i18n.BundleUtils;
/**
* Encapsulation of version-specific WS-Addressing constants.
*/
-public interface AddressingConstants {
+public class AddressingConstants {
+ private static final ResourceBundle BUNDLE =
+ BundleUtils.getBundle(AddressingConstants.class);
+
+
+ public AddressingConstants() {
+ }
+
/**
* @return namespace defined by the normative WS-Addressing Core schema
*/
- String getNamespaceURI();
-
+ public String getNamespaceURI() {
+ return Names.WSA_NAMESPACE_NAME;
+ }
+
+
/**
* @return namespace defined by the normative WS-Addressing WSDL bindings
* schema
*/
- String getWSDLNamespaceURI();
-
+ public String getWSDLNamespaceURI() {
+ return Names.WSA_NAMESPACE_WSDL_NAME;
+ }
+
/**
* @return QName of the WSDL extensiblity element
*/
- QName getWSDLExtensibilityQName();
-
+ public QName getWSDLExtensibilityQName() {
+ return Names.WSAW_USING_ADDRESSING_QNAME;
+ }
+
/**
* @return QName of the wsaw:Action element
*/
- QName getWSDLActionQName();
-
+ public QName getWSDLActionQName() {
+ return Names.WSAW_ACTION_QNAME;
+ }
+
/**
* @return Anonymous address URI
*/
- String getAnonymousURI();
+ public String getAnonymousURI() {
+ return Names.WSA_ANONYMOUS_ADDRESS;
+ }
/**
* @return None address URI
*/
- String getNoneURI();
-
+ public String getNoneURI() {
+ return Names.WSA_NONE_ADDRESS;
+ }
+
/**
* @return QName of the From addressing header
*/
- QName getFromQName();
+ public QName getFromQName() {
+ return Names.WSA_FROM_QNAME;
+ }
/**
* @return QName of the To addressing header
- */
- QName getToQName();
+ */
+ public QName getToQName() {
+ return Names.WSA_TO_QNAME;
+ }
/**
* @return QName of the ReplyTo addressing header
*/
- QName getReplyToQName();
+ public QName getReplyToQName() {
+ return Names.WSA_REPLYTO_QNAME;
+ }
/**
* @return QName of the FaultTo addressing header
*/
- QName getFaultToQName();
-
+ public QName getFaultToQName() {
+ return Names.WSA_FAULTTO_QNAME;
+ }
+
/**
* @return QName of the Action addressing header
*/
- QName getActionQName();
+ public QName getActionQName() {
+ return Names.WSA_ACTION_QNAME;
+ }
/**
* @return QName of the MessageID addressing header
*/
- QName getMessageIDQName();
+ public QName getMessageIDQName() {
+ return Names.WSA_MESSAGEID_QNAME;
+ }
/**
- * @return Default value for RelationshipType indicating a reply
+ * @return Default value for RelationshipType indicating a reply
* to the related message
*/
- String getRelationshipReply();
+ public String getRelationshipReply() {
+ return Names.WSA_RELATIONSHIP_REPLY;
+ }
/**
* @return QName of the RelatesTo addressing header
*/
- QName getRelatesToQName();
+ public QName getRelatesToQName() {
+ return Names.WSA_RELATESTO_QNAME;
+ }
/**
* @return QName of the Relationship addressing header
*/
- QName getRelationshipTypeQName();
-
+ public QName getRelationshipTypeQName() {
+ return Names.WSA_RELATIONSHIPTYPE_QNAME;
+ }
+
/**
* @return QName of the Metadata
*/
- QName getMetadataQName();
+ public QName getMetadataQName() {
+ return Names.WSA_METADATA_QNAME;
+ }
/**
* @return QName of the Address
*/
- QName getAddressQName();
+ public QName getAddressQName() {
+ return Names.WSA_ADDRESS_QNAME;
+ }
+
/**
* @return QName of the reference parameter marker
*/
- QName getIsReferenceParameterQName();
+ public QName getIsReferenceParameterQName() {
+ return Names.WSA_IS_REFERENCE_PARAMETER_QNAME;
+ }
/**
* @return QName of the Invalid Message Addressing Property fault subcode
*/
- QName getInvalidMapQName();
+ public QName getInvalidMapQName() {
+ return Names.INVALID_MAP_QNAME;
+ }
/**
* @return QName of the Message Addressing Property Required fault subcode
*/
- QName getMapRequiredQName();
+ public QName getMapRequiredQName() {
+ return Names.MAP_REQUIRED_QNAME;
+ }
/**
* @return QName of the Destination Unreachable fault subcode
*/
- QName getDestinationUnreachableQName();
+ public QName getDestinationUnreachableQName() {
+ return Names.DESTINATION_UNREACHABLE_QNAME;
+ }
/**
* @return QName of the Action Not Supported fault subcode
*/
- QName getActionNotSupportedQName();
+ public QName getActionNotSupportedQName() {
+ return Names.ACTION_NOT_SUPPORTED_QNAME;
+ }
/**
* @return QName of the Endpoint Unavailable fault subcode
*/
- QName getEndpointUnavailableQName();
+ public QName getEndpointUnavailableQName() {
+ return Names.ENDPOINT_UNAVAILABLE_QNAME;
+ }
/**
* @return Default Fault Action
*/
- String getDefaultFaultAction();
+ public String getDefaultFaultAction() {
+ return Names.WSA_DEFAULT_FAULT_ACTION;
+ }
/**
* @return Action Not Supported text
*/
- String getActionNotSupportedText();
+ public String getActionNotSupportedText() {
+ return BUNDLE.getString("ACTION_NOT_SUPPORTED_MSG");
+ }
/**
* @return Destination Unreachable text
*/
- String getDestinationUnreachableText();
-
+ public String getDestinationUnreachableText() {
+ return BUNDLE.getString("DESTINATION_UNREACHABLE_MSG");
+ }
+
/**
* @return Endpoint Unavailable text
*/
- String getEndpointUnavailableText();
-
+ public String getEndpointUnavailableText() {
+ return BUNDLE.getString("ENDPOINT_UNAVAILABLE_MSG");
+ }
+
/**
* @return Invalid Message Addressing Property text
- */
- String getInvalidMapText();
-
+ */
+ public String getInvalidMapText() {
+ return BUNDLE.getString("INVALID_MAP_MSG");
+ }
+
/**
* @return Message Addressing Property Required text
- */
- String getMapRequiredText();
+ */
+ public String getMapRequiredText() {
+ return BUNDLE.getString("MAP_REQUIRED_MSG");
+ }
/**
* @return Duplicate Message ID text
*/
- String getDuplicateMessageIDText();
+ public String getDuplicateMessageIDText() {
+ return BUNDLE.getString("DUPLICATE_MESSAGE_ID_MSG");
+ }
}
Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingProperties.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingProperties.java?rev=1502591&r1=1502590&r2=1502591&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingProperties.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/AddressingProperties.java Fri Jul 12 15:42:49 2013
@@ -19,124 +19,260 @@
package org.apache.cxf.ws.addressing;
+import java.util.ArrayList;
import java.util.List;
import javax.xml.namespace.QName;
-
/**
* Abstraction of Message Addressing Properties.
*/
-public interface AddressingProperties extends AddressingType {
+public class AddressingProperties {
+ private EndpointReferenceType to;
+ private AttributedURIType toURIType;
+ private EndpointReferenceType from;
+ private AttributedURIType messageID;
+ private EndpointReferenceType replyTo;
+ private EndpointReferenceType faultTo;
+ private RelatesToType relatesTo;
+ private AttributedURIType action;
+ private String namespaceURI;
+ private QName duplicate;
+ private List<QName> mustUnderstand;
+
+ /**
+ * Constructor, defaults to 2005/08 namespace.
+ */
+ public AddressingProperties() {
+ this(Names.WSA_NAMESPACE_NAME);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param uri the namespace URI
+ */
+ public AddressingProperties(String uri) {
+ namespaceURI = uri;
+ }
+
+ public EndpointReferenceType getToEndpointReference() {
+ return to;
+ }
+
/**
* Accessor for the <b>To</b> property.
- * @return current value of To property
+ * @return To property
*/
- EndpointReferenceType getToEndpointReference();
+ public AttributedURIType getTo() {
+ if (toURIType == null) {
+ return null != to ? to.getAddress() : null;
+ }
+ return toURIType;
+ }
/**
- * Accessor for the <b>To</b> property.
- * @return current value of To property
- */
- AttributedURIType getTo();
-
- /**
* Mutator for the <b>To</b> property.
- * @param epr new value for To property
+ * @param iri new value for To property
*/
- void setTo(EndpointReferenceType epr);
-
+ public void setTo(AttributedURIType t) {
+ toURIType = t;
+ }
/**
* Mutator for the <b>To</b> property.
- * @param epr new value for To property
+ * @param iri new value for To property
*/
- void setTo(AttributedURIType epr);
-
+ public void setTo(EndpointReferenceType epr) {
+ to = epr;
+ toURIType = null;
+ }
/**
* Accessor for the <b>From</b> property.
* @return current value of From property
*/
- EndpointReferenceType getFrom();
+ public EndpointReferenceType getFrom() {
+ return from;
+ }
/**
* Mutator for the <b>From</b> property.
* @param epr new value for From property
*/
- void setFrom(EndpointReferenceType epr);
+ public void setFrom(EndpointReferenceType epr) {
+ from = epr;
+ }
/**
* Accessor for the <b>MessageID</b> property.
* @return current value of MessageID property
*/
- AttributedURIType getMessageID();
+ public AttributedURIType getMessageID() {
+ return messageID;
+ }
/**
* Mutator for the <b>MessageID</b> property.
- * @param iri new value for MessageID property
+ * @param iri new value for MessageTo property
*/
- void setMessageID(AttributedURIType iri);
+ public void setMessageID(AttributedURIType iri) {
+ messageID = iri;
+ }
/**
* Accessor for the <b>ReplyTo</b> property.
* @return current value of ReplyTo property
*/
- EndpointReferenceType getReplyTo();
+ public EndpointReferenceType getReplyTo() {
+ return replyTo;
+ }
/**
* Mutator for the <b>ReplyTo</b> property.
* @param ref new value for ReplyTo property
*/
- void setReplyTo(EndpointReferenceType ref);
-
+ public void setReplyTo(EndpointReferenceType ref) {
+ replyTo = ref;
+ }
+
/**
* Accessor for the <b>FaultTo</b> property.
* @return current value of FaultTo property
*/
- EndpointReferenceType getFaultTo();
+ public EndpointReferenceType getFaultTo() {
+ return faultTo;
+ }
/**
* Mutator for the <b>FaultTo</b> property.
* @param ref new value for FaultTo property
*/
- void setFaultTo(EndpointReferenceType ref);
-
+ public void setFaultTo(EndpointReferenceType ref) {
+ faultTo = ref;
+ }
+
/**
* Accessor for the <b>RelatesTo</b> property.
* @return current value of RelatesTo property
*/
- RelatesToType getRelatesTo();
+ public RelatesToType getRelatesTo() {
+ return relatesTo;
+ }
/**
* Mutator for the <b>RelatesTo</b> property.
- * @param relatesTo new value for RelatesTo property
+ * @param rel new value for RelatesTo property
*/
- void setRelatesTo(RelatesToType relatesTo);
+ public void setRelatesTo(RelatesToType rel) {
+ relatesTo = rel;
+ }
/**
* Accessor for the <b>Action</b> property.
* @return current value of Action property
*/
- AttributedURIType getAction();
+ public AttributedURIType getAction() {
+ return action;
+ }
/**
* Mutator for the <b>Action</b> property.
* @param iri new value for Action property
*/
- void setAction(AttributedURIType iri);
+ public void setAction(AttributedURIType iri) {
+ action = iri;
+ }
+
+ /**
+ * @return WS-Addressing namespace URI
+ */
+ public String getNamespaceURI() {
+ return namespaceURI;
+ }
/**
* Used to specify a different WS-Addressing namespace URI,
* so as to cause MAPs to be exposed (i.e. encoded in externalized
* message with a different WS-Addressing version).
+ *
+ * @return WS-Addressing namespace URI
*/
- void exposeAs(String uri);
-
+ public void exposeAs(String uri) {
+ namespaceURI = uri;
+ }
+
+ public void setDuplicate(QName dup) {
+ duplicate = dup;
+ }
+
+ public QName getDuplicate() {
+ return duplicate;
+ }
+
+ public List<QName> getMustUnderstand() {
+ if (mustUnderstand == null) {
+ mustUnderstand = new ArrayList<QName>();
+ }
+ return mustUnderstand;
+ }
+
+ public String toString() {
+ StringBuilder buf = new StringBuilder();
+ buf.append("[");
+ if (null != messageID) {
+ if (buf.length() > 1) {
+ buf.append(", ");
+ }
+ buf.append("MessageId: ");
+ buf.append(messageID.getValue());
+ }
+ if (null != action) {
+ if (buf.length() > 1) {
+ buf.append(", ");
+ }
+ buf.append("Action: ");
+ buf.append(action.getValue());
+ }
+ if (null != to) {
+ if (buf.length() > 1) {
+ buf.append(", ");
+ }
+ buf.append("To: ");
+ buf.append(to.getAddress().getValue());
+ }
+ if (null != replyTo) {
+ AttributedURIType address = replyTo.getAddress();
+ if (null != address) {
+ if (buf.length() > 1) {
+ buf.append(", ");
+ }
+ buf.append("ReplyTo: ");
+ buf.append(address.getValue());
+ }
+ }
+ if (null != faultTo) {
+ AttributedURIType address = faultTo.getAddress();
+ if (null != address) {
+ if (buf.length() > 1) {
+ buf.append(", ");
+ }
+ buf.append("FaultTo: ");
+ buf.append(address.getValue());
+ }
+ }
+ if (null != relatesTo) {
+ if (buf.length() > 1) {
+ buf.append(", ");
+ }
+ buf.append("RelatesTo: ");
+ buf.append(relatesTo.getValue());
+ }
+ buf.append("]");
+ return buf.toString();
+
+ }
- AddressingProperties createCompatibleResponseProperties();
-
- QName getDuplicate();
- void setDuplicate(QName qn);
- List<QName> getMustUnderstand();
-
+ public AddressingProperties createCompatibleResponseProperties() {
+ return new AddressingProperties(getNamespaceURI());
+ }
}
Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingConstantsImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingConstantsImpl.java?rev=1502591&r1=1502590&r2=1502591&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingConstantsImpl.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingConstantsImpl.java Fri Jul 12 15:42:49 2013
@@ -20,243 +20,13 @@
package org.apache.cxf.ws.addressing.impl;
-import java.util.ResourceBundle;
-
-import javax.xml.namespace.QName;
-
-import org.apache.cxf.common.i18n.BundleUtils;
-import org.apache.cxf.common.util.PackageUtils;
import org.apache.cxf.ws.addressing.AddressingConstants;
-import org.apache.cxf.ws.addressing.Names;
/**
* Encapsulation of version-specific WS-Addressing constants.
*/
-public class AddressingConstantsImpl implements AddressingConstants {
-
- private static final ResourceBundle BUNDLE =
- BundleUtils.getBundle(AddressingConstantsImpl.class);
-
- public AddressingConstantsImpl() {
- }
-
- /**
- * @return namespace defined by the normative WS-Addressing Core schema
- */
- public String getNamespaceURI() {
- return Names.WSA_NAMESPACE_NAME;
- }
-
-
- /**
- * @return namespace defined by the normative WS-Addressing WSDL bindings
- * schema
- */
- public String getWSDLNamespaceURI() {
- return Names.WSA_NAMESPACE_WSDL_NAME;
- }
-
- /**
- * @return QName of the WSDL extensiblity element
- */
- public QName getWSDLExtensibilityQName() {
- return Names.WSAW_USING_ADDRESSING_QNAME;
- }
-
- /**
- * @return QName of the wsaw:Action element
- */
- public QName getWSDLActionQName() {
- return Names.WSAW_ACTION_QNAME;
- }
-
- /**
- * @return Anonymous address URI
- */
- public String getAnonymousURI() {
- return Names.WSA_ANONYMOUS_ADDRESS;
- }
-
- /**
- * @return None address URI
- */
- public String getNoneURI() {
- return Names.WSA_NONE_ADDRESS;
- }
-
- /**
- * @return QName of the From addressing header
- */
- public QName getFromQName() {
- return Names.WSA_FROM_QNAME;
- }
-
- /**
- * @return QName of the To addressing header
- */
- public QName getToQName() {
- return Names.WSA_TO_QNAME;
- }
-
- /**
- * @return QName of the ReplyTo addressing header
- */
- public QName getReplyToQName() {
- return Names.WSA_REPLYTO_QNAME;
- }
-
- /**
- * @return QName of the FaultTo addressing header
- */
- public QName getFaultToQName() {
- return Names.WSA_FAULTTO_QNAME;
- }
-
- /**
- * @return QName of the Action addressing header
- */
- public QName getActionQName() {
- return Names.WSA_ACTION_QNAME;
- }
-
- /**
- * @return QName of the MessageID addressing header
- */
- public QName getMessageIDQName() {
- return Names.WSA_MESSAGEID_QNAME;
- }
-
- /**
- * @return Default value for RelationshipType indicating a reply
- * to the related message
- */
- public String getRelationshipReply() {
- return Names.WSA_RELATIONSHIP_REPLY;
- }
-
- /**
- * @return QName of the RelatesTo addressing header
- */
- public QName getRelatesToQName() {
- return Names.WSA_RELATESTO_QNAME;
- }
-
- /**
- * @return QName of the Relationship addressing header
- */
- public QName getRelationshipTypeQName() {
- return Names.WSA_RELATIONSHIPTYPE_QNAME;
- }
-
- /**
- * @return QName of the Metadata
- */
- public QName getMetadataQName() {
- return Names.WSA_METADATA_QNAME;
- }
-
- /**
- * @return QName of the Address
- */
- public QName getAddressQName() {
- return Names.WSA_ADDRESS_QNAME;
- }
-
- /**
- * @return package name of the implementation
- */
- public String getPackageName() {
- return PackageUtils.getPackageName(AddressingConstantsImpl.class);
- }
-
- /**
- * @return QName of the reference parameter marker
- */
- public QName getIsReferenceParameterQName() {
- return Names.WSA_IS_REFERENCE_PARAMETER_QNAME;
- }
-
- /**
- * @return QName of the Invalid Message Addressing Property fault subcode
- */
- public QName getInvalidMapQName() {
- return Names.INVALID_MAP_QNAME;
- }
-
- /**
- * @return QName of the Message Addressing Property Required fault subcode
- */
- public QName getMapRequiredQName() {
- return Names.MAP_REQUIRED_QNAME;
- }
-
- /**
- * @return QName of the Destination Unreachable fault subcode
- */
- public QName getDestinationUnreachableQName() {
- return Names.DESTINATION_UNREACHABLE_QNAME;
- }
-
- /**
- * @return QName of the Action Not Supported fault subcode
- */
- public QName getActionNotSupportedQName() {
- return Names.ACTION_NOT_SUPPORTED_QNAME;
- }
-
- /**
- * @return QName of the Endpoint Unavailable fault subcode
- */
- public QName getEndpointUnavailableQName() {
- return Names.ENDPOINT_UNAVAILABLE_QNAME;
- }
-
- /**
- * @return Default Fault Action
- */
- public String getDefaultFaultAction() {
- return Names.WSA_DEFAULT_FAULT_ACTION;
- }
-
- /**
- * @return Action Not Supported text
- */
- public String getActionNotSupportedText() {
- return BUNDLE.getString("ACTION_NOT_SUPPORTED_MSG");
- }
+public class AddressingConstantsImpl extends AddressingConstants {
- /**
- * @return Destination Unreachable text
- */
- public String getDestinationUnreachableText() {
- return BUNDLE.getString("DESTINATION_UNREACHABLE_MSG");
- }
-
- /**
- * @return Endpoint Unavailable text
- */
- public String getEndpointUnavailableText() {
- return BUNDLE.getString("ENDPOINT_UNAVAILABLE_MSG");
- }
- /**
- * @return Invalid Message Addressing Property text
- */
- public String getInvalidMapText() {
- return BUNDLE.getString("INVALID_MAP_MSG");
- }
-
- /**
- * @return Message Addressing Property Required text
- */
- public String getMapRequiredText() {
- return BUNDLE.getString("MAP_REQUIRED_MSG");
- }
-
- /**
- * @return Duplicate Message ID text
- */
- public String getDuplicateMessageIDText() {
- return BUNDLE.getString("DUPLICATE_MESSAGE_ID_MSG");
- }
+
}
Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingPropertiesImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingPropertiesImpl.java?rev=1502591&r1=1502590&r2=1502591&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingPropertiesImpl.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/AddressingPropertiesImpl.java Fri Jul 12 15:42:49 2013
@@ -19,33 +19,13 @@
package org.apache.cxf.ws.addressing.impl;
-import java.util.ArrayList;
-import java.util.List;
-
-
-import javax.xml.namespace.QName;
-
import org.apache.cxf.ws.addressing.AddressingProperties;
-import org.apache.cxf.ws.addressing.AttributedURIType;
-import org.apache.cxf.ws.addressing.EndpointReferenceType;
import org.apache.cxf.ws.addressing.Names;
-import org.apache.cxf.ws.addressing.RelatesToType;
/**
* Abstraction of Message Addressing Properties.
*/
-public class AddressingPropertiesImpl implements AddressingProperties {
- private EndpointReferenceType to;
- private AttributedURIType toURIType;
- private EndpointReferenceType from;
- private AttributedURIType messageID;
- private EndpointReferenceType replyTo;
- private EndpointReferenceType faultTo;
- private RelatesToType relatesTo;
- private AttributedURIType action;
- private String namespaceURI;
- private QName duplicate;
- private List<QName> mustUnderstand;
+public class AddressingPropertiesImpl extends AddressingProperties {
/**
* Constructor, defaults to 2005/08 namespace.
@@ -60,227 +40,8 @@ public class AddressingPropertiesImpl im
* @param uri the namespace URI
*/
public AddressingPropertiesImpl(String uri) {
- namespaceURI = uri;
- }
-
- public EndpointReferenceType getToEndpointReference() {
- return to;
- }
-
- /**
- * Accessor for the <b>To</b> property.
- * @return To property
- */
- public AttributedURIType getTo() {
- if (toURIType == null) {
- return null != to ? to.getAddress() : null;
- }
- return toURIType;
- }
-
- /**
- * Mutator for the <b>To</b> property.
- * @param iri new value for To property
- */
- public void setTo(AttributedURIType t) {
- toURIType = t;
- }
- /**
- * Mutator for the <b>To</b> property.
- * @param iri new value for To property
- */
- public void setTo(EndpointReferenceType epr) {
- to = epr;
- toURIType = null;
- }
- /**
- * Accessor for the <b>From</b> property.
- * @return current value of From property
- */
- public EndpointReferenceType getFrom() {
- return from;
- }
-
- /**
- * Mutator for the <b>From</b> property.
- * @param epr new value for From property
- */
- public void setFrom(EndpointReferenceType epr) {
- from = epr;
- }
-
- /**
- * Accessor for the <b>MessageID</b> property.
- * @return current value of MessageID property
- */
- public AttributedURIType getMessageID() {
- return messageID;
- }
-
- /**
- * Mutator for the <b>MessageID</b> property.
- * @param iri new value for MessageTo property
- */
- public void setMessageID(AttributedURIType iri) {
- messageID = iri;
- }
-
- /**
- * Accessor for the <b>ReplyTo</b> property.
- * @return current value of ReplyTo property
- */
- public EndpointReferenceType getReplyTo() {
- return replyTo;
- }
-
- /**
- * Mutator for the <b>ReplyTo</b> property.
- * @param ref new value for ReplyTo property
- */
- public void setReplyTo(EndpointReferenceType ref) {
- replyTo = ref;
+ super(uri);
}
- /**
- * Accessor for the <b>FaultTo</b> property.
- * @return current value of FaultTo property
- */
- public EndpointReferenceType getFaultTo() {
- return faultTo;
- }
-
- /**
- * Mutator for the <b>FaultTo</b> property.
- * @param ref new value for FaultTo property
- */
- public void setFaultTo(EndpointReferenceType ref) {
- faultTo = ref;
- }
-
-
- /**
- * Accessor for the <b>RelatesTo</b> property.
- * @return current value of RelatesTo property
- */
- public RelatesToType getRelatesTo() {
- return relatesTo;
- }
-
- /**
- * Mutator for the <b>RelatesTo</b> property.
- * @param rel new value for RelatesTo property
- */
- public void setRelatesTo(RelatesToType rel) {
- relatesTo = rel;
- }
-
- /**
- * Accessor for the <b>Action</b> property.
- * @return current value of Action property
- */
- public AttributedURIType getAction() {
- return action;
- }
-
- /**
- * Mutator for the <b>Action</b> property.
- * @param iri new value for Action property
- */
- public void setAction(AttributedURIType iri) {
- action = iri;
- }
-
- /**
- * @return WS-Addressing namespace URI
- */
- public String getNamespaceURI() {
- return namespaceURI;
- }
-
- /**
- * Used to specify a different WS-Addressing namespace URI,
- * so as to cause MAPs to be exposed (i.e. encoded in externalized
- * message with a different WS-Addressing version).
- *
- * @return WS-Addressing namespace URI
- */
- public void exposeAs(String uri) {
- namespaceURI = uri;
- }
-
- public void setDuplicate(QName dup) {
- duplicate = dup;
- }
-
- public QName getDuplicate() {
- return duplicate;
- }
-
- public List<QName> getMustUnderstand() {
- if (mustUnderstand == null) {
- mustUnderstand = new ArrayList<QName>();
- }
- return mustUnderstand;
- }
-
- public String toString() {
- StringBuilder buf = new StringBuilder();
- buf.append("[");
- if (null != messageID) {
- if (buf.length() > 1) {
- buf.append(", ");
- }
- buf.append("MessageId: ");
- buf.append(messageID.getValue());
- }
- if (null != action) {
- if (buf.length() > 1) {
- buf.append(", ");
- }
- buf.append("Action: ");
- buf.append(action.getValue());
- }
- if (null != to) {
- if (buf.length() > 1) {
- buf.append(", ");
- }
- buf.append("To: ");
- buf.append(to.getAddress().getValue());
- }
- if (null != replyTo) {
- AttributedURIType address = replyTo.getAddress();
- if (null != address) {
- if (buf.length() > 1) {
- buf.append(", ");
- }
- buf.append("ReplyTo: ");
- buf.append(address.getValue());
- }
- }
- if (null != faultTo) {
- AttributedURIType address = faultTo.getAddress();
- if (null != address) {
- if (buf.length() > 1) {
- buf.append(", ");
- }
- buf.append("FaultTo: ");
- buf.append(address.getValue());
- }
- }
- if (null != relatesTo) {
- if (buf.length() > 1) {
- buf.append(", ");
- }
- buf.append("RelatesTo: ");
- buf.append(relatesTo.getValue());
- }
- buf.append("]");
- return buf.toString();
-
- }
-
- public AddressingProperties createCompatibleResponseProperties() {
- return new AddressingPropertiesImpl(getNamespaceURI());
- }
}