camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [17/24] camel git commit: camel-http-common - as a common module
Date Thu, 23 Jul 2015 12:58:19 GMT
camel-http-common - as a common module


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/05019f6f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/05019f6f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/05019f6f

Branch: refs/heads/master
Commit: 05019f6f0d63447ca9f9e3bc22bd0671580d5433
Parents: ac1f1af
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Jul 23 11:31:35 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Jul 23 15:04:34 2015 +0200

----------------------------------------------------------------------
 components/camel-gae/pom.xml                    | 49 ++++++++++----------
 .../gae/bind/HttpBindingInvocationHandler.java  |  4 +-
 .../camel/component/gae/http/GHttpBinding.java  |  2 -
 .../component/gae/http/GHttpComponent.java      | 13 +-----
 .../camel/component/gae/http/GHttpEndpoint.java | 16 ++-----
 .../camel/component/gae/task/GTaskBinding.java  |  7 +--
 .../component/gae/task/GTaskComponent.java      | 15 ++----
 .../camel/component/gae/task/GTaskEndpoint.java | 12 ++---
 .../component/gae/task/GTaskBindingTest.java    |  2 +-
 9 files changed, 43 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/05019f6f/components/camel-gae/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-gae/pom.xml b/components/camel-gae/pom.xml
index 981e395..3b537c5 100644
--- a/components/camel-gae/pom.xml
+++ b/components/camel-gae/pom.xml
@@ -15,7 +15,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
@@ -30,18 +31,18 @@
   <description>Camel GAE support</description>
 
   <properties>
-        <camel.osgi.import.before.defaults>
-            javax.servlet.*;version="${servlet-version-range}"
-        </camel.osgi.import.before.defaults>
-	<camel.osgi.export.pkg>org.apache.camel.component.gae.*</camel.osgi.export.pkg>
-	<camel.osgi.export.service>
-		org.apache.camel.spi.ComponentResolver;component=gauth,
-		org.apache.camel.spi.ComponentResolver;component=ghttp,
-		org.apache.camel.spi.ComponentResolver;component=ghttps,
-		org.apache.camel.spi.ComponentResolver;component=glogin,
-		org.apache.camel.spi.ComponentResolver;component=gmail,
-		org.apache.camel.spi.ComponentResolver;component=gtask
-	</camel.osgi.export.service>
+    <camel.osgi.import.before.defaults>
+      javax.servlet.*;version="${servlet-version-range}"
+    </camel.osgi.import.before.defaults>
+    <camel.osgi.export.pkg>org.apache.camel.component.gae.*</camel.osgi.export.pkg>
+    <camel.osgi.export.service>
+      org.apache.camel.spi.ComponentResolver;component=gauth,
+      org.apache.camel.spi.ComponentResolver;component=ghttp,
+      org.apache.camel.spi.ComponentResolver;component=ghttps,
+      org.apache.camel.spi.ComponentResolver;component=glogin,
+      org.apache.camel.spi.ComponentResolver;component=gmail,
+      org.apache.camel.spi.ComponentResolver;component=gtask
+    </camel.osgi.export.service>
   </properties>
 
   <dependencies>
@@ -134,15 +135,15 @@
     </dependency>
   </dependencies>
 
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <forkCount>1</forkCount>
-		    <reuseForks>false</reuseForks>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <forkCount>1</forkCount>
+          <reuseForks>false</reuseForks>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>

http://git-wip-us.apache.org/repos/asf/camel/blob/05019f6f/components/camel-gae/src/main/java/org/apache/camel/component/gae/bind/HttpBindingInvocationHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/bind/HttpBindingInvocationHandler.java
b/components/camel-gae/src/main/java/org/apache/camel/component/gae/bind/HttpBindingInvocationHandler.java
index 21328e5..e2229ea 100644
--- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/bind/HttpBindingInvocationHandler.java
+++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/bind/HttpBindingInvocationHandler.java
@@ -21,8 +21,8 @@ import java.lang.reflect.Method;
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
-import org.apache.camel.component.http.HttpBinding;
-import org.apache.camel.component.http.HttpMessage;
+import org.apache.camel.http.common.HttpBinding;
+import org.apache.camel.http.common.HttpMessage;
 
 /**
  * Post-processes {@link HttpBinding} invocations by delegating to an

http://git-wip-us.apache.org/repos/asf/camel/blob/05019f6f/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpBinding.java
b/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpBinding.java
index 1493edd..fd86339 100644
--- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpBinding.java
+++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpBinding.java
@@ -20,7 +20,6 @@ import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.net.URL;
 import java.util.zip.GZIPInputStream;
-
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -28,7 +27,6 @@ import com.google.appengine.api.urlfetch.HTTPHeader;
 import com.google.appengine.api.urlfetch.HTTPMethod;
 import com.google.appengine.api.urlfetch.HTTPRequest;
 import com.google.appengine.api.urlfetch.HTTPResponse;
-
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.gae.bind.InboundBinding;

http://git-wip-us.apache.org/repos/asf/camel/blob/05019f6f/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpComponent.java
b/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpComponent.java
index 1aaa6b1..c5bb708 100644
--- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpComponent.java
+++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpComponent.java
@@ -18,21 +18,16 @@ package org.apache.camel.component.gae.http;
 
 import java.net.URI;
 import java.util.Map;
-
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import com.google.appengine.api.urlfetch.HTTPRequest;
 import com.google.appengine.api.urlfetch.HTTPResponse;
-
 import org.apache.camel.Endpoint;
 import org.apache.camel.component.gae.bind.InboundBinding;
 import org.apache.camel.component.gae.bind.OutboundBinding;
-import org.apache.camel.component.http.HttpClientConfigurer;
 import org.apache.camel.component.servlet.ServletComponent;
 import org.apache.camel.component.servlet.ServletEndpoint;
-import org.apache.commons.httpclient.HttpConnectionManager;
-import org.apache.commons.httpclient.params.HttpClientParams;
 
 /**
  * The <a href="http://camel.apache.org/ghttp.html">Google App Engine HTTP
@@ -65,11 +60,7 @@ public class GHttpComponent extends ServletComponent {
     }
 
     @Override
-    protected ServletEndpoint createServletEndpoint(String endpointUri,
-            ServletComponent component, URI httpUri, HttpClientParams params,
-            HttpConnectionManager httpConnectionManager,
-            HttpClientConfigurer clientConfigurer) throws Exception {
-        return new GHttpEndpoint(endpointUri, component, httpUri, params,
-                httpConnectionManager, clientConfigurer);
+    protected ServletEndpoint createServletEndpoint(String endpointUri, ServletComponent
component, URI httpUri) throws Exception {
+        return new GHttpEndpoint(endpointUri, component, httpUri);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/05019f6f/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpEndpoint.java
b/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpEndpoint.java
index 897a09b..75e3cf7 100644
--- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpEndpoint.java
+++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/http/GHttpEndpoint.java
@@ -34,15 +34,12 @@ import org.apache.camel.component.gae.bind.HttpBindingInvocationHandler;
 import org.apache.camel.component.gae.bind.InboundBinding;
 import org.apache.camel.component.gae.bind.OutboundBinding;
 import org.apache.camel.component.gae.bind.OutboundBindingSupport;
-import org.apache.camel.component.http.HttpBinding;
-import org.apache.camel.component.http.HttpClientConfigurer;
 import org.apache.camel.component.servlet.ServletComponent;
 import org.apache.camel.component.servlet.ServletEndpoint;
+import org.apache.camel.http.common.HttpBinding;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.util.URISupport;
 import org.apache.camel.util.UnsafeUriCharactersEncoder;
-import org.apache.commons.httpclient.HttpConnectionManager;
-import org.apache.commons.httpclient.params.HttpClientParams;
 
 /**
  * Represents a <a href="http://camel.apache.org/ghttp.html">Google App Engine
@@ -62,12 +59,9 @@ public class GHttpEndpoint extends ServletEndpoint implements OutboundBindingSup
     private OutboundBinding<GHttpEndpoint, HTTPRequest, HTTPResponse> outboundBinding;
     private InboundBinding<GHttpEndpoint, HttpServletRequest, HttpServletResponse>
inboundBinding;
     
-    public GHttpEndpoint(String endpointUri, ServletComponent component,
-            URI httpUri, HttpClientParams params,
-            HttpConnectionManager httpConnectionManager,
-            HttpClientConfigurer clientConfigurer) throws URISyntaxException {
+    public GHttpEndpoint(String endpointUri, ServletComponent component, URI httpUri) throws
URISyntaxException {
         // set the endpoint uri with httpUri as we need to create http producer here
-        super(httpUri.toString(), component, httpUri, params, httpConnectionManager, clientConfigurer);
+        super(httpUri.toString(), component, httpUri);
         urlFetchService = URLFetchServiceFactory.getURLFetchService();
     }
 
@@ -129,12 +123,12 @@ public class GHttpEndpoint extends ServletEndpoint implements OutboundBindingSup
     }
 
     /**
-     * Proxies the {@link HttpBinding} returned by {@link super#getBinding()}
+     * Proxies the {@link org.apache.camel.http.common.HttpBinding} returned by {@link super#getBinding()}
      * with a dynamic proxy. The proxy's invocation handler further delegates to
      * {@link InboundBinding#readRequest(org.apache.camel.Endpoint, Exchange, Object)}
      * .
      * 
-     * @return proxied {@link HttpBinding}.
+     * @return proxied {@link org.apache.camel.http.common.HttpBinding}.
      */
     @Override
     public HttpBinding getBinding() {

http://git-wip-us.apache.org/repos/asf/camel/blob/05019f6f/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskBinding.java
b/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskBinding.java
index 1ca9acd..ba971d3 100644
--- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskBinding.java
+++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskBinding.java
@@ -20,19 +20,16 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import com.google.appengine.api.taskqueue.TaskOptions;
-
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.gae.bind.InboundBinding;
 import org.apache.camel.component.gae.bind.OutboundBinding;
-import org.apache.camel.component.http.DefaultHttpBinding;
-import org.apache.camel.component.http.HttpMessage;
 import org.apache.camel.spi.HeaderFilterStrategy;
 
 /**
  * Binds the {@link TaskOptions} of the task queueing service to a Camel
  * {@link Exchange} for outbound communication. For inbound communication a
- * {@link HttpMessage} is bound to {@link Exchange}.
+ * {@link org.apache.camel.http.common.HttpMessage} is bound to {@link Exchange}.
  */
 public class GTaskBinding implements 
     OutboundBinding <GTaskEndpoint, TaskOptions, Void>,
@@ -98,7 +95,7 @@ public class GTaskBinding implements
      * @see GTaskBinding#GTASK_QUEUE_NAME
      * @see GTaskBinding#GTASK_TASK_NAME
      * @see GTaskBinding#GTASK_RETRY_COUNT
-     * @see DefaultHttpBinding#readRequest(HttpServletRequest, HttpMessage)
+     * @see org.apache.camel.http.common.DefaultHttpBinding#readRequest(HttpServletRequest,
org.apache.camel.http.common.HttpMessage)
      */
     public Exchange readRequest(GTaskEndpoint endpoint, Exchange exchange, HttpServletRequest
request) {
         readRequestHeaders(endpoint, exchange, request);

http://git-wip-us.apache.org/repos/asf/camel/blob/05019f6f/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskComponent.java
b/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskComponent.java
index d248d5d..da029e6 100644
--- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskComponent.java
+++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskComponent.java
@@ -18,22 +18,17 @@ package org.apache.camel.component.gae.task;
 
 import java.net.URI;
 import java.util.Map;
-
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import com.google.appengine.api.taskqueue.QueueFactory;
 import com.google.appengine.api.taskqueue.TaskOptions;
-
 import org.apache.camel.Endpoint;
 import org.apache.camel.component.gae.bind.InboundBinding;
 import org.apache.camel.component.gae.bind.OutboundBinding;
-import org.apache.camel.component.http.HttpClientConfigurer;
-import org.apache.camel.component.http.HttpConsumer;
 import org.apache.camel.component.servlet.ServletComponent;
 import org.apache.camel.component.servlet.ServletEndpoint;
-import org.apache.commons.httpclient.HttpConnectionManager;
-import org.apache.commons.httpclient.params.HttpClientParams;
+import org.apache.camel.http.common.HttpConsumer;
 
 /**
  * The <a href="http://camel.apache.org/gtask.html">Google App Engine Task
@@ -79,12 +74,8 @@ public class GTaskComponent extends ServletComponent {
     }
 
     @Override
-    protected ServletEndpoint createServletEndpoint(String endpointUri,
-            ServletComponent component, URI httpUri, HttpClientParams params,
-            HttpConnectionManager httpConnectionManager,
-            HttpClientConfigurer clientConfigurer) throws Exception {
-        return new GTaskEndpoint(endpointUri, component, httpUri, params,
-                httpConnectionManager, clientConfigurer);
+    protected ServletEndpoint createServletEndpoint(String endpointUri, ServletComponent
component, URI httpUri) throws Exception {
+        return new GTaskEndpoint(endpointUri, component, httpUri);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/05019f6f/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskEndpoint.java
b/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskEndpoint.java
index 371094e..e688d67 100644
--- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskEndpoint.java
+++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/task/GTaskEndpoint.java
@@ -30,16 +30,13 @@ import org.apache.camel.component.gae.bind.HttpBindingInvocationHandler;
 import org.apache.camel.component.gae.bind.InboundBinding;
 import org.apache.camel.component.gae.bind.OutboundBinding;
 import org.apache.camel.component.gae.bind.OutboundBindingSupport;
-import org.apache.camel.component.http.HttpBinding;
-import org.apache.camel.component.http.HttpClientConfigurer;
 import org.apache.camel.component.servlet.ServletComponent;
 import org.apache.camel.component.servlet.ServletEndpoint;
+import org.apache.camel.http.common.HttpBinding;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
-import org.apache.commons.httpclient.HttpConnectionManager;
-import org.apache.commons.httpclient.params.HttpClientParams;
 
 /**
  * Represents a <a href="http://camel.apache.org/gtask.html">Google App Engine Task
Queueing endpoint</a>.
@@ -61,11 +58,8 @@ public class GTaskEndpoint extends ServletEndpoint implements OutboundBindingSup
     @UriParam(label = "producer")
     private String outboundBindingRef;
 
-    public GTaskEndpoint(String endpointUri, ServletComponent component,
-            URI httpUri, HttpClientParams params,
-            HttpConnectionManager httpConnectionManager,
-            HttpClientConfigurer clientConfigurer) throws URISyntaxException {
-        super(endpointUri, component, httpUri, params, httpConnectionManager, clientConfigurer);
+    public GTaskEndpoint(String endpointUri, ServletComponent component, URI httpUri) throws
URISyntaxException {
+        super(endpointUri, component, httpUri);
     }
 
     public OutboundBinding<GTaskEndpoint, TaskOptions, Void> getOutboundBinding() {

http://git-wip-us.apache.org/repos/asf/camel/blob/05019f6f/components/camel-gae/src/test/java/org/apache/camel/component/gae/task/GTaskBindingTest.java
----------------------------------------------------------------------
diff --git a/components/camel-gae/src/test/java/org/apache/camel/component/gae/task/GTaskBindingTest.java
b/components/camel-gae/src/test/java/org/apache/camel/component/gae/task/GTaskBindingTest.java
index 8cc42df..0154529 100644
--- a/components/camel-gae/src/test/java/org/apache/camel/component/gae/task/GTaskBindingTest.java
+++ b/components/camel-gae/src/test/java/org/apache/camel/component/gae/task/GTaskBindingTest.java
@@ -27,7 +27,7 @@ import com.google.appengine.api.taskqueue.dev.QueueStateInfo.TaskStateInfo;
 import com.google.appengine.tools.development.testing.LocalServiceTestHelper;
 import com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig;
 import org.apache.camel.Exchange;
-import org.apache.camel.component.http.HttpMessage;
+import org.apache.camel.http.common.HttpMessage;
 import org.apache.camel.impl.DefaultExchange;
 import org.junit.After;
 import org.junit.Before;


Mime
View raw message