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 2016/01/10 15:35:45 UTC

[1/2] camel git commit: Compoent docs

Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x dbaee38dc -> f7530e5d8
  refs/heads/master 93a891bc4 -> 90088a188


Compoent docs


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

Branch: refs/heads/master
Commit: 90088a188a195bcb5f3d38523bab1e3debf98ba8
Parents: 93a891b
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Jan 10 15:35:11 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Jan 10 15:35:11 2016 +0100

----------------------------------------------------------------------
 .../component/twitter/TwitterConfiguration.java | 31 ++++++++++++++++----
 .../twitter/TwitterEndpointPolling.java         |  2 +-
 .../component/twitter/UriConfigurationTest.java |  2 +-
 3 files changed, 28 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/90088a18/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
index 5cfee43..df34a4d 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
@@ -31,7 +31,10 @@ import twitter4j.conf.ConfigurationBuilder;
 @UriParams
 public class TwitterConfiguration {
 
-    @UriPath(description = "What kind of type to use") @Metadata(required = "true")
+    @UriPath(description = "The kind of endpoint", enums = "directmessage,search,streaming/filter,streaming/sample,streaming/user"
+            + ",timeline/home,timeline/mentions,timeline/retweetsofme,timeline/user") @Metadata(required = "true")
+    private String kind;
+    @UriParam(label = "consumer", defaultValue = "direct", enums = "polling,direct,event")
     private EndpointType type = EndpointType.DIRECT;
     @UriParam
     private String accessToken;
@@ -86,6 +89,8 @@ public class TwitterConfiguration {
      * if we only need twitterStream.
      */
     private Twitter twitter;
+
+    @UriParam(label = "consumer,advanced")
     private TwitterStream twitterStream;
 
     /**
@@ -126,7 +131,6 @@ public class TwitterConfiguration {
         return confBuilder.build();
     }
 
-
     public Twitter getTwitter() {
         if (twitter == null) {
             twitter = new TwitterFactory(getConfiguration()).getInstance();
@@ -142,6 +146,9 @@ public class TwitterConfiguration {
         return twitterStream;
     }
 
+    /**
+     * To use a custom instance of TwitterStream
+     */
     public void setTwitterStream(TwitterStream twitterStream) {
         this.twitterStream = twitterStream;
     }
@@ -150,10 +157,21 @@ public class TwitterConfiguration {
         if (twitterStream == null) {
             twitterStream = new TwitterStreamFactory(getConfiguration()).getInstance();
         }
-
         return twitterStream;
     }
 
+    public String getKind() {
+        return kind;
+    }
+
+    /**
+     * What polling mode to use, direct, polling or event based.
+     * The event mode is only supported when the endpoint kind is event based.
+     */
+    public void setKind(String kind) {
+        this.kind = kind;
+    }
+
     public String getConsumerKey() {
         return consumerKey;
     }
@@ -235,6 +253,9 @@ public class TwitterConfiguration {
         return type;
     }
 
+    /**
+     * Endpoint type to use. Only streaming supports event type.
+     */
     public void setType(EndpointType type) {
         this.type = type;
     }
@@ -353,11 +374,11 @@ public class TwitterConfiguration {
     /**
      * The http proxy port which can be used for the camel-twitter. Can also be configured on the TwitterComponent level instead.
      */
-    public void setHttpProxyPort(int httpProxyPort) {
+    public void setHttpProxyPort(Integer httpProxyPort) {
         this.httpProxyPort = httpProxyPort;
     }
 
-    public int getHttpProxyPort() {
+    public Integer getHttpProxyPort() {
         return httpProxyPort;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/90088a18/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
index 4a77d29..7b6ed34 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
@@ -32,7 +32,7 @@ import org.apache.camel.spi.UriParam;
  * This component integrates with Twitter to send tweets or search for tweets and more.
  */
 @ManagedResource(description = "Managed Twitter Endpoint")
-@UriEndpoint(scheme = "twitter", title = "Twitter", syntax = "twitter:type", consumerClass = Twitter4JConsumer.class, label = "api,social")
+@UriEndpoint(scheme = "twitter", title = "Twitter", syntax = "twitter:kind", consumerClass = Twitter4JConsumer.class, label = "api,social")
 public class TwitterEndpointPolling extends DefaultPollingEndpoint implements TwitterEndpoint {
 
     @UriParam

http://git-wip-us.apache.org/repos/asf/camel/blob/90088a18/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
index 840796e..62d75ad 100644
--- a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
+++ b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
@@ -58,7 +58,7 @@ public class UriConfigurationTest extends Assert {
         TwitterEndpoint twitterEndpoint = (TwitterEndpoint) endpoint;
         
         assertEquals("example.com", twitterEndpoint.getProperties().getHttpProxyHost());
-        assertEquals(3338, twitterEndpoint.getProperties().getHttpProxyPort());
+        assertEquals(Integer.valueOf(3338), twitterEndpoint.getProperties().getHttpProxyPort());
         assertEquals("test", twitterEndpoint.getProperties().getHttpProxyUser());
         assertEquals("pwd", twitterEndpoint.getProperties().getHttpProxyPassword());
     }


[2/2] camel git commit: Compoent docs

Posted by da...@apache.org.
Compoent docs


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

Branch: refs/heads/camel-2.16.x
Commit: f7530e5d8903d734da9a931b9d0098c2378bd287
Parents: dbaee38
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Jan 10 15:35:11 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Jan 10 15:35:37 2016 +0100

----------------------------------------------------------------------
 .../component/twitter/TwitterConfiguration.java | 31 ++++++++++++++++----
 .../twitter/TwitterEndpointPolling.java         |  2 +-
 .../component/twitter/UriConfigurationTest.java |  2 +-
 3 files changed, 28 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f7530e5d/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
index 5cfee43..df34a4d 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
@@ -31,7 +31,10 @@ import twitter4j.conf.ConfigurationBuilder;
 @UriParams
 public class TwitterConfiguration {
 
-    @UriPath(description = "What kind of type to use") @Metadata(required = "true")
+    @UriPath(description = "The kind of endpoint", enums = "directmessage,search,streaming/filter,streaming/sample,streaming/user"
+            + ",timeline/home,timeline/mentions,timeline/retweetsofme,timeline/user") @Metadata(required = "true")
+    private String kind;
+    @UriParam(label = "consumer", defaultValue = "direct", enums = "polling,direct,event")
     private EndpointType type = EndpointType.DIRECT;
     @UriParam
     private String accessToken;
@@ -86,6 +89,8 @@ public class TwitterConfiguration {
      * if we only need twitterStream.
      */
     private Twitter twitter;
+
+    @UriParam(label = "consumer,advanced")
     private TwitterStream twitterStream;
 
     /**
@@ -126,7 +131,6 @@ public class TwitterConfiguration {
         return confBuilder.build();
     }
 
-
     public Twitter getTwitter() {
         if (twitter == null) {
             twitter = new TwitterFactory(getConfiguration()).getInstance();
@@ -142,6 +146,9 @@ public class TwitterConfiguration {
         return twitterStream;
     }
 
+    /**
+     * To use a custom instance of TwitterStream
+     */
     public void setTwitterStream(TwitterStream twitterStream) {
         this.twitterStream = twitterStream;
     }
@@ -150,10 +157,21 @@ public class TwitterConfiguration {
         if (twitterStream == null) {
             twitterStream = new TwitterStreamFactory(getConfiguration()).getInstance();
         }
-
         return twitterStream;
     }
 
+    public String getKind() {
+        return kind;
+    }
+
+    /**
+     * What polling mode to use, direct, polling or event based.
+     * The event mode is only supported when the endpoint kind is event based.
+     */
+    public void setKind(String kind) {
+        this.kind = kind;
+    }
+
     public String getConsumerKey() {
         return consumerKey;
     }
@@ -235,6 +253,9 @@ public class TwitterConfiguration {
         return type;
     }
 
+    /**
+     * Endpoint type to use. Only streaming supports event type.
+     */
     public void setType(EndpointType type) {
         this.type = type;
     }
@@ -353,11 +374,11 @@ public class TwitterConfiguration {
     /**
      * The http proxy port which can be used for the camel-twitter. Can also be configured on the TwitterComponent level instead.
      */
-    public void setHttpProxyPort(int httpProxyPort) {
+    public void setHttpProxyPort(Integer httpProxyPort) {
         this.httpProxyPort = httpProxyPort;
     }
 
-    public int getHttpProxyPort() {
+    public Integer getHttpProxyPort() {
         return httpProxyPort;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f7530e5d/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
index 2d42b93..b6564d2 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
@@ -32,7 +32,7 @@ import org.apache.camel.spi.UriParam;
  * Twitter polling endpoint
  */
 @ManagedResource(description = "Managed Twitter Endpoint")
-@UriEndpoint(scheme = "twitter", title = "Twitter", syntax = "twitter:type", consumerClass = Twitter4JConsumer.class, label = "api,social")
+@UriEndpoint(scheme = "twitter", title = "Twitter", syntax = "twitter:kind", consumerClass = Twitter4JConsumer.class, label = "api,social")
 public class TwitterEndpointPolling extends DefaultPollingEndpoint implements TwitterEndpoint {
 
     @UriParam

http://git-wip-us.apache.org/repos/asf/camel/blob/f7530e5d/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
index 840796e..62d75ad 100644
--- a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
+++ b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
@@ -58,7 +58,7 @@ public class UriConfigurationTest extends Assert {
         TwitterEndpoint twitterEndpoint = (TwitterEndpoint) endpoint;
         
         assertEquals("example.com", twitterEndpoint.getProperties().getHttpProxyHost());
-        assertEquals(3338, twitterEndpoint.getProperties().getHttpProxyPort());
+        assertEquals(Integer.valueOf(3338), twitterEndpoint.getProperties().getHttpProxyPort());
         assertEquals("test", twitterEndpoint.getProperties().getHttpProxyUser());
         assertEquals("pwd", twitterEndpoint.getProperties().getHttpProxyPassword());
     }