You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2017/01/19 19:57:34 UTC

svn commit: r1779511 - in /axis/axis2/java/core/trunk/modules/transport: http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/ http/src/org/apache/axis2/transport/http/impl/httpclient4/

Author: veithen
Date: Thu Jan 19 19:57:34 2017
New Revision: 1779511

URL: http://svn.apache.org/viewvc?rev=1779511&view=rev
Log:
Dismantle the populateCommonProperties methods.

Modified:
    axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/HTTPSenderImpl.java
    axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/RequestImpl.java
    axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/HTTPSenderImpl.java
    axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestImpl.java

Modified: axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/HTTPSenderImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/HTTPSenderImpl.java?rev=1779511&r1=1779510&r2=1779511&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/HTTPSenderImpl.java (original)
+++ axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/HTTPSenderImpl.java Thu Jan 19 19:57:34 2017
@@ -206,33 +206,6 @@ public class HTTPSenderImpl extends HTTP
     }
 
     /**
-     * Method used to copy all the common properties
-     * 
-     * @param msgContext
-     *            - The messageContext of the request message
-     * @param url
-     *            - The target URL
-     * @param httpMethod
-     *            - The http method used to send the request
-     * @param httpClient
-     *            - The httpclient used to send the request
-     * @param soapActionString
-     *            - The soap action atring of the request message
-     * @return MessageFormatter - The messageFormatter for the relavent request
-     *         message
-     * @throws AxisFault
-     *             - Thrown in case an exception occurs
-     */
-    protected void populateCommonProperties(MessageContext msgContext, URL url,
-            HttpMethodBase httpMethod, HttpClient httpClient)
-            throws AxisFault {
-
-        httpMethod.setPath(url.getPath());
-
-        httpMethod.setQueryString(url.getQuery());
-    }
-
-    /**
      * This is used to get the dynamically set time out values from the message
      * context. If the values are not available or invalid then the default
      * values or the values set by the configuration will be used

Modified: axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/RequestImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/RequestImpl.java?rev=1779511&r1=1779510&r2=1779511&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/RequestImpl.java (original)
+++ axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/RequestImpl.java Thu Jan 19 19:57:34 2017
@@ -92,7 +92,8 @@ final class RequestImpl implements Reque
             }
             method = entityEnclosingMethod;
         }
-        sender.populateCommonProperties(msgContext, url, method, httpClient);
+        method.setPath(url.getPath());
+        method.setQueryString(url.getQuery());
         // TODO: this is fishy; it means that we may end up modifying a HostConfiguration from a cached HTTP client
         HostConfiguration config = httpClient.getHostConfiguration();
         if (config == null) {

Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/HTTPSenderImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/HTTPSenderImpl.java?rev=1779511&r1=1779510&r2=1779511&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/HTTPSenderImpl.java (original)
+++ axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/HTTPSenderImpl.java Thu Jan 19 19:57:34 2017
@@ -56,7 +56,6 @@ import org.apache.http.params.HttpParams
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
@@ -216,30 +215,6 @@ public class HTTPSenderImpl extends HTTP
         }
     }
 
-    /**
-     * Method used to copy all the common properties
-     *
-     * @param msgContext       - The messageContext of the request message
-     * @param url              - The target URL
-     * @param httpMethod       - The http method used to send the request
-     * @param httpClient       - The httpclient used to send the request
-     * @param soapActionString - The soap action atring of the request message
-     * @return MessageFormatter - The messageFormatter for the relavent request
-     *         message
-     * @throws org.apache.axis2.AxisFault - Thrown in case an exception occurs
-     */
-    protected void populateCommonProperties(MessageContext msgContext, URL url,
-                                                        HttpRequestBase httpMethod,
-                                                        AbstractHttpClient httpClient)
-            throws AxisFault {
-
-        try {
-            httpMethod.setURI(url.toURI());
-        } catch (URISyntaxException e) {
-            log.error("Error in URI : " + url, e);
-        }
-    }
-
     /**
      * This is used to get the dynamically set time out values from the message
      * context. If the values are not available or invalid then the default

Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestImpl.java?rev=1779511&r1=1779510&r2=1779511&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestImpl.java (original)
+++ axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestImpl.java Thu Jan 19 19:57:34 2017
@@ -19,6 +19,7 @@
 package org.apache.axis2.transport.http.impl.httpclient4;
 
 import java.io.IOException;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
@@ -92,7 +93,11 @@ final class RequestImpl implements Reque
             entityEnclosingRequest.setEntity(new AxisRequestEntityImpl(requestEntity));
             method = entityEnclosingRequest;
         }
-        sender.populateCommonProperties(msgContext, url, method, httpClient);
+        try {
+            method.setURI(url.toURI());
+        } catch (URISyntaxException ex) {
+            throw AxisFault.makeFault(ex);
+        }
         int port = url.getPort();
         String protocol = url.getProtocol();
         if (port == -1) {