You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2012/07/14 09:02:26 UTC

svn commit: r1361477 - /camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java

Author: davsclaus
Date: Sat Jul 14 07:02:25 2012
New Revision: 1361477

URL: http://svn.apache.org/viewvc?rev=1361477&view=rev
Log:
CAMEL-5431: Restored to configure twitter on component to keep API. Breet's patch removed that.

Modified:
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java?rev=1361477&r1=1361476&r2=1361477&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java (original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java Sat Jul 14 07:02:25 2012
@@ -27,11 +27,22 @@ import org.apache.camel.impl.DefaultComp
  */
 public class TwitterComponent extends DefaultComponent {
 
+    private String consumerKey;
+    private String consumerSecret;
+    private String accessToken;
+    private String accessTokenSecret;
+
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
 
         TwitterConfiguration properties = new TwitterConfiguration();
 
-        // Automatically sets all our properties.
+        // set options from component
+        properties.setConsumerKey(consumerKey);
+        properties.setConsumerSecret(consumerSecret);
+        properties.setAccessToken(accessToken);
+        properties.setAccessTokenSecret(accessTokenSecret);
+
+        // and then override from parameters
         setProperties(properties, parameters);
 
         TwitterEndpoint endpoint;
@@ -48,4 +59,36 @@ public class TwitterComponent extends De
         }
         return endpoint;
     }
+
+    public String getAccessToken() {
+        return accessToken;
+    }
+
+    public void setAccessToken(String accessToken) {
+        this.accessToken = accessToken;
+    }
+
+    public String getAccessTokenSecret() {
+        return accessTokenSecret;
+    }
+
+    public void setAccessTokenSecret(String accessTokenSecret) {
+        this.accessTokenSecret = accessTokenSecret;
+    }
+
+    public String getConsumerKey() {
+        return consumerKey;
+    }
+
+    public void setConsumerKey(String consumerKey) {
+        this.consumerKey = consumerKey;
+    }
+
+    public String getConsumerSecret() {
+        return consumerSecret;
+    }
+
+    public void setConsumerSecret(String consumerSecret) {
+        this.consumerSecret = consumerSecret;
+    }
 }