axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davidills...@apache.org
Subject svn commit: r428110 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/ core/src/org/apache/axis2/addressing/ core/src/org/apache/axis2/client/ core/src/org/apache/axis2/util/
Date Wed, 02 Aug 2006 19:38:51 GMT
Author: davidillsley
Date: Wed Aug  2 12:38:51 2006
New Revision: 428110

URL: http://svn.apache.org/viewvc?rev=428110&view=rev
Log:
Patch from Brian for AXIS2-954
Simplify the handling of the relationship type by returning a default value if it has not
been set explicitly in a RelatesTo object.
Thanks Brian.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/RelatesTo.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=428110&r1=428109&r2=428110&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
Wed Aug  2 12:38:51 2006
@@ -200,7 +200,7 @@
                     String relationshipType = relatesTo[i].getRelationshipType();
 
                     if (relatesToHeader != null) {
-                        if (Final.WSA_DEFAULT_RELATIONSHIP_TYPE.equals(relationshipType)
|| relationshipType == null || "".equals(relationshipType)) {
+                        if (Final.WSA_DEFAULT_RELATIONSHIP_TYPE.equals(relationshipType)
|| "".equals(relationshipType)) {
                             relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
                                     this.relationshipType,
                                     addressingNamespaceObject);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/RelatesTo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/RelatesTo.java?rev=428110&r1=428109&r2=428110&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/RelatesTo.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/RelatesTo.java
Wed Aug  2 12:38:51 2006
@@ -57,10 +57,13 @@
     }
 
     /**
-     * Method getRelationshipType
+     * Method getRelationshipType. If the relationship type has not been set it returns
+     * the default value {@link AddressingConstants.Final.WSA_DEFAULT_RELATIONSHIP_TYPE}
      */
     public String getRelationshipType() {
-        return relationshipType;
+        return (relationshipType != null ?
+                    relationshipType :
+                    AddressingConstants.Final.WSA_DEFAULT_RELATIONSHIP_TYPE);
     }
 
     /**

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java?rev=428110&r1=428109&r2=428110&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java Wed
Aug  2 12:38:51 2006
@@ -199,12 +199,7 @@
         for(int i=0;relationships != null && i<relationships.size();i++) {
             RelatesTo relatesTo = (RelatesTo) relationships.get(i);
             String relationshipType = relatesTo.getRelationshipType();
-            if((type.equals(AddressingConstants.Final.WSA_DEFAULT_RELATIONSHIP_TYPE) ||
-                    type.equals(AddressingConstants.Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE))
-                    && relationshipType == null) {
-                return relatesTo;
-            }
-            if(relationshipType != null && relationshipType.equals(type)) {
+            if(relationshipType.equals(type)) {
                 return relatesTo;
             }
         }
@@ -222,10 +217,8 @@
         for(int i=0;relationships != null && i<relationships.size();i++) {
             RelatesTo relatesTo = (RelatesTo) relationships.get(i);
             String relationshipType = relatesTo.getRelationshipType();
-            if(relationshipType == null) {
-                return relatesTo;
-            }else if (relationshipType.equals(AddressingConstants.Final.WSA_DEFAULT_RELATIONSHIP_TYPE)
-                    || relationshipType.equals(AddressingConstants.Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE))
{
+            if (relationshipType.equals(AddressingConstants.Final.WSA_DEFAULT_RELATIONSHIP_TYPE)
+                || relationshipType.equals(AddressingConstants.Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE))
{
                 return relatesTo;
             }
         }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java?rev=428110&r1=428109&r2=428110&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java Wed Aug
 2 12:38:51 2006
@@ -79,10 +79,7 @@
         }
 
         newmsgCtx.setFaultTo(oldOptions.getTo());
-        newmsgCtx.addRelatesTo(
-                new RelatesTo(
-                        oldOptions.getMessageId(),
-                        AddressingConstants.Final.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE));
+        newmsgCtx.addRelatesTo(new RelatesTo(oldOptions.getMessageId())); //Uses the default
relationship type
                 
         AxisOperation ao = inMessageContext.getAxisOperation();
         if(ao!=null && ao.getOutputAction()!=null){



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message