camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject git commit: CAMEL-6431: First spike of camel-geocoder component.
Date Thu, 06 Jun 2013 06:00:06 GMT
Updated Branches:
  refs/heads/master c382286c6 -> 2bf6688be


CAMEL-6431: First spike of camel-geocoder component.


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

Branch: refs/heads/master
Commit: 2bf6688be8119da62258fd98143be718e874bbe4
Parents: c382286
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Jun 6 07:59:58 2013 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Jun 6 07:59:58 2013 +0200

----------------------------------------------------------------------
 .../camel/component/geocoder/GeoCoderEndpoint.java |   18 +++++++++++++++
 .../camel/component/geocoder/GeoCoderProducer.java |   13 +++++++++-
 2 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2bf6688b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java
b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java
index 9613d48..24b79b2 100644
--- a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java
+++ b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderEndpoint.java
@@ -29,6 +29,8 @@ public class GeoCoderEndpoint extends DefaultEndpoint {
     private String address;
     private String latlng;
     private String language = "en";
+    private String clientId;
+    private String clientKey;
     private boolean headersOnly;
 
     public GeoCoderEndpoint() {
@@ -81,4 +83,20 @@ public class GeoCoderEndpoint extends DefaultEndpoint {
     public void setHeadersOnly(boolean headersOnly) {
         this.headersOnly = headersOnly;
     }
+
+    public String getClientId() {
+        return clientId;
+    }
+
+    public void setClientId(String clientId) {
+        this.clientId = clientId;
+    }
+
+    public String getClientKey() {
+        return clientKey;
+    }
+
+    public void setClientKey(String clientKey) {
+        this.clientKey = clientKey;
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2bf6688b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderProducer.java
b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderProducer.java
index 435bc7c..23ec0eb 100644
--- a/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderProducer.java
+++ b/components/camel-geocoder/src/main/java/org/apache/camel/component/geocoder/GeoCoderProducer.java
@@ -42,9 +42,9 @@ import static org.apache.camel.util.ObjectHelper.notNull;
  */
 public class GeoCoderProducer extends DefaultProducer {
     private static final transient Logger LOG = LoggerFactory.getLogger(GeoCoderProducer.class);
-    private GeoCoderEndpoint endpoint;
 
-    private final Geocoder geocoder = new Geocoder();
+    private GeoCoderEndpoint endpoint;
+    private Geocoder geocoder;
 
     public GeoCoderProducer(GeoCoderEndpoint endpoint) {
         super(endpoint);
@@ -193,4 +193,13 @@ public class GeoCoderProducer extends DefaultProducer {
         return null;
     }
 
+    @Override
+    protected void doStart() throws Exception {
+        if (endpoint.getClientId() != null) {
+            geocoder = new Geocoder(endpoint.getClientId(), endpoint.getClientKey());
+        } else {
+            geocoder = new Geocoder();
+        }
+    }
+
 }


Mime
View raw message