You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/05/26 17:26:12 UTC

svn commit: r778748 - in /camel/branches/camel-1.x: ./ components/camel-http/src/main/java/org/apache/camel/component/http/

Author: ningjiang
Date: Tue May 26 15:26:12 2009
New Revision: 778748

URL: http://svn.apache.org/viewvc?rev=778748&view=rev
Log:
Merged revisions 778689,778701 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r778689 | ningjiang | 2009-05-26 21:14:50 +0800 (Tue, 26 May 2009) | 1 line
  
  CAMEL-1599 applied patch with thanks to Jonathan, also introduced a CompositeHttpConfigurer to hold the multi-configurer
........
  r778701 | ningjiang | 2009-05-26 21:38:41 +0800 (Tue, 26 May 2009) | 1 line
  
  CAMEL-1599 Fixed the cs errors
........

Added:
    camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/CompositeHttpConfigurer.java
      - copied unchanged from r778701, camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CompositeHttpConfigurer.java
    camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/ProxyHttpClientConfigurer.java
      - copied unchanged from r778701, camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/ProxyHttpClientConfigurer.java
Modified:
    camel/branches/camel-1.x/   (props changed)
    camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 26 15:26:12 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,756939,757636,757693,757743,757865,758539,758563,758600,758617,758692,758990,759362,759453,759887,759931,760003,760890,760909,760937,761194,761536,761583,761607,762047,762633,762650,762935,763095,763484,763551,765154,765686,765729,765743,765824,766016,766289,766584,766588,766590,766602,766673,767403,767824,768342,769239,769346,769368,769434,770172,770906,771303,773193,773446,773781,774192,774383,774658-774659,776198,776289,776504,776975,778102,778689-778701

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java?rev=778748&r1=778747&r2=778748&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java (original)
+++ camel/branches/camel-1.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java Tue May 26 15:26:12 2009
@@ -80,17 +80,35 @@
             httpBinding = CamelContextHelper.mandatoryLookup(getCamelContext(), ref, HttpBinding.class);
         }
         
+        // lookup http client front configurer in the registry if provided
+        ref = getAndRemoveParameter(parameters, "httpClientConfigurerRef", String.class);
+        if (ref != null) {
+            httpClientConfigurer = CamelContextHelper.mandatoryLookup(getCamelContext(), ref, HttpClientConfigurer.class);
+        }
+        
         // check the user name and password for basic authentication
         String username = getAndRemoveParameter(parameters, "username", String.class);
         String password = getAndRemoveParameter(parameters, "password", String.class);
         if (username != null && password != null) {
-            httpClientConfigurer = new BasicAuthenticationHttpClientConfigurer(username, password);
+            
+            httpClientConfigurer = CompositeHttpConfigurer.combineConfigurers(
+                httpClientConfigurer, 
+                new BasicAuthenticationHttpClientConfigurer(username, password));
         }
         
-        // lookup http client front configurer in the registry if provided
-        ref = getAndRemoveParameter(parameters, "httpClientConfigurerRef", String.class);
-        if (ref != null) {
-            httpClientConfigurer = CamelContextHelper.mandatoryLookup(getCamelContext(), ref, HttpClientConfigurer.class);
+        // check the proxy details for proxy configuration
+        String host = getAndRemoveParameter(parameters, "proxyHost", String.class);
+        Integer port = getAndRemoveParameter(parameters, "proxyPort", Integer.class);
+        if (host != null && port != null) {
+            String proxyUsername = getAndRemoveParameter(parameters, "proxyUsername", String.class);
+            String proxyPassword = getAndRemoveParameter(parameters, "proxyPassword", String.class);
+            if (proxyUsername != null && proxyPassword != null) {
+                httpClientConfigurer = CompositeHttpConfigurer.combineConfigurers(
+                    httpClientConfigurer, new ProxyHttpClientConfigurer(host, port, proxyUsername, proxyPassword));
+            } else {
+                httpClientConfigurer = CompositeHttpConfigurer.combineConfigurers(
+                    httpClientConfigurer, new ProxyHttpClientConfigurer(host, port));
+            }
         }
     }
     
@@ -123,8 +141,8 @@
             endpoint.setBinding(httpBinding);
         }
         return endpoint;
-    }
-
+    }    
+   
     @Override
     protected boolean useIntrospectionOnEndpoint() {
         return false;