Author: davsclaus
Date: Sat Jul 14 07:04:40 2012
New Revision: 1361479
URL: http://svn.apache.org/viewvc?rev=1361479&view=rev
Log:
CAMEL-5431: Restored to configure twitter on component to keep API. Breet's
patch removed that.
Modified:
camel/branches/camel-2.10.x/ (props changed)
camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1361477
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Jul 14 07:04:40 2012
@@ -1 +1 @@
-/camel/trunk:1-1358964,1359013,1359197,1359226,1359265,1359341,1359383,1360031,1360241,1360339,1360525-1360527,1360581,1360583,1360719,1361116-1361117
+/camel/trunk:1-1358964,1359013,1359197,1359226,1359265,1359341,1359383,1360031,1360241,1360339,1360525-1360527,1360581,1360583,1360719,1361116-1361117,1361477
Modified:
camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java?rev=1361479&r1=1361478&r2=1361479&view=diff
==============================================================================
---
camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
(original)
+++
camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
Sat Jul 14 07:04:40 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;
+ }
}