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 2018/04/19 07:26:01 UTC

[camel] branch camel-2.21.x updated (d871b34 -> a8ec1c9)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from d871b34  CAMEL-12457: file consumer - Should not use readlock by default
     new 5fb63d6  Add support for Extended mode for full text (#2292)
     new a8ec1c9  CAMEL-12458: camel-twitter - Should support extended mode by default

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel-twitter/src/main/docs/twitter-component.adoc     |  3 ++-
 .../src/main/docs/twitter-directmessage-component.adoc     |  3 ++-
 .../src/main/docs/twitter-search-component.adoc            |  3 ++-
 .../src/main/docs/twitter-streaming-component.adoc         |  3 ++-
 .../src/main/docs/twitter-timeline-component.adoc          |  3 ++-
 .../camel/component/twitter/TwitterConfiguration.java      | 14 ++++++++++++++
 6 files changed, 24 insertions(+), 5 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.

[camel] 01/02: Add support for Extended mode for full text (#2292)

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 5fb63d6bfc3f5c12d9bd90f75cbc3bdc3cdb948d
Author: Akhilesh Singh <me...@gmail.com>
AuthorDate: Thu Apr 19 17:19:13 2018 +1000

    Add support for Extended mode for full text (#2292)
---
 .../camel/component/twitter/TwitterConfiguration.java   | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

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 f4a32bb..3c5266a 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
@@ -74,6 +74,8 @@ public class TwitterConfiguration {
     private Double radius;
     @UriParam(label = "consumer,advanced", defaultValue = "km", enums = "km,mi")
     private String distanceMetric;
+    @UriParam(label = "consumer,advanced")
+    private Boolean extendedMode;
 
     /**
      * Singleton, on demand instances of Twitter4J's Twitter & TwitterStream.
@@ -109,6 +111,7 @@ public class TwitterConfiguration {
         confBuilder.setOAuthConsumerSecret(consumerSecret);
         confBuilder.setOAuthAccessToken(accessToken);
         confBuilder.setOAuthAccessTokenSecret(accessTokenSecret);
+        confBuilder.setTweetModeExtended(getExtendedMode());
         if (getHttpProxyHost() != null) {
             confBuilder.setHttpProxyHost(getHttpProxyHost());
         }
@@ -395,5 +398,19 @@ public class TwitterConfiguration {
     public void setDistanceMetric(String distanceMetric) {
         this.distanceMetric = distanceMetric;
     }
+    
+    /**
+     * Used for enabling full text from twitter.
+     * <p/>
+     */
+    public void setExtendedMode(Boolean extendedMode) {
+        this.radius = radius;
+    }
+
+    public Boolean getExtendedMode() {
+        return extendedMode;
+    }
+    
+    
 
 }

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.

[camel] 02/02: CAMEL-12458: camel-twitter - Should support extended mode by default

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a8ec1c9bb9cc1630cccb4d0ae651827d679160ab
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Apr 19 09:23:18 2018 +0200

    CAMEL-12458: camel-twitter - Should support extended mode by default
---
 .../camel-twitter/src/main/docs/twitter-component.adoc    |  3 ++-
 .../src/main/docs/twitter-directmessage-component.adoc    |  3 ++-
 .../src/main/docs/twitter-search-component.adoc           |  3 ++-
 .../src/main/docs/twitter-streaming-component.adoc        |  3 ++-
 .../src/main/docs/twitter-timeline-component.adoc         |  3 ++-
 .../camel/component/twitter/TwitterConfiguration.java     | 15 ++++++---------
 6 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/components/camel-twitter/src/main/docs/twitter-component.adoc b/components/camel-twitter/src/main/docs/twitter-component.adoc
index 414bf5c..cd77832 100644
--- a/components/camel-twitter/src/main/docs/twitter-component.adoc
+++ b/components/camel-twitter/src/main/docs/twitter-component.adoc
@@ -160,7 +160,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (43 parameters):
+==== Query Parameters (44 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -173,6 +173,7 @@ with the following path and query parameters:
 | *distanceMetric* (consumer) | Used by the non-stream geography search, to search by radius using the configured metrics. The unit can either be mi for miles, or km for kilometers. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. | km | String
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
+| *extendedMode* (consumer) | Used for enabling full text from twitter (eg receive tweets that contains more than 140 characters). | true | boolean
 | *latitude* (consumer) | Used by the non-stream geography search to search by latitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. |  | Double
 | *locations* (consumer) | Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter. A pair is defined as lat,lon. And multiple paris can be separated by semi colon. |  | String
 | *longitude* (consumer) | Used by the non-stream geography search to search by longitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. |  | Double
diff --git a/components/camel-twitter/src/main/docs/twitter-directmessage-component.adoc b/components/camel-twitter/src/main/docs/twitter-directmessage-component.adoc
index 20e783f..51f75b0 100644
--- a/components/camel-twitter/src/main/docs/twitter-directmessage-component.adoc
+++ b/components/camel-twitter/src/main/docs/twitter-directmessage-component.adoc
@@ -49,7 +49,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (41 parameters):
+==== Query Parameters (42 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -61,6 +61,7 @@ with the following path and query parameters:
 | *distanceMetric* (consumer) | Used by the non-stream geography search, to search by radius using the configured metrics. The unit can either be mi for miles, or km for kilometers. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. | km | String
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
+| *extendedMode* (consumer) | Used for enabling full text from twitter (eg receive tweets that contains more than 140 characters). | true | boolean
 | *latitude* (consumer) | Used by the non-stream geography search to search by latitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. |  | Double
 | *locations* (consumer) | Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter. A pair is defined as lat,lon. And multiple paris can be separated by semi colon. |  | String
 | *longitude* (consumer) | Used by the non-stream geography search to search by longitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. |  | Double
diff --git a/components/camel-twitter/src/main/docs/twitter-search-component.adoc b/components/camel-twitter/src/main/docs/twitter-search-component.adoc
index 269b3f3..7beda61 100644
--- a/components/camel-twitter/src/main/docs/twitter-search-component.adoc
+++ b/components/camel-twitter/src/main/docs/twitter-search-component.adoc
@@ -49,7 +49,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (41 parameters):
+==== Query Parameters (42 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -61,6 +61,7 @@ with the following path and query parameters:
 | *distanceMetric* (consumer) | Used by the non-stream geography search, to search by radius using the configured metrics. The unit can either be mi for miles, or km for kilometers. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. | km | String
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
+| *extendedMode* (consumer) | Used for enabling full text from twitter (eg receive tweets that contains more than 140 characters). | true | boolean
 | *latitude* (consumer) | Used by the non-stream geography search to search by latitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. |  | Double
 | *locations* (consumer) | Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter. A pair is defined as lat,lon. And multiple paris can be separated by semi colon. |  | String
 | *longitude* (consumer) | Used by the non-stream geography search to search by longitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. |  | Double
diff --git a/components/camel-twitter/src/main/docs/twitter-streaming-component.adoc b/components/camel-twitter/src/main/docs/twitter-streaming-component.adoc
index 409dc86..a2bf82b 100644
--- a/components/camel-twitter/src/main/docs/twitter-streaming-component.adoc
+++ b/components/camel-twitter/src/main/docs/twitter-streaming-component.adoc
@@ -49,7 +49,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (42 parameters):
+==== Query Parameters (43 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -61,6 +61,7 @@ with the following path and query parameters:
 | *distanceMetric* (consumer) | Used by the non-stream geography search, to search by radius using the configured metrics. The unit can either be mi for miles, or km for kilometers. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. | km | String
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
+| *extendedMode* (consumer) | Used for enabling full text from twitter (eg receive tweets that contains more than 140 characters). | true | boolean
 | *latitude* (consumer) | Used by the non-stream geography search to search by latitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. |  | Double
 | *locations* (consumer) | Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter. A pair is defined as lat,lon. And multiple paris can be separated by semi colon. |  | String
 | *longitude* (consumer) | Used by the non-stream geography search to search by longitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. |  | Double
diff --git a/components/camel-twitter/src/main/docs/twitter-timeline-component.adoc b/components/camel-twitter/src/main/docs/twitter-timeline-component.adoc
index 9b34e33..84354ba 100644
--- a/components/camel-twitter/src/main/docs/twitter-timeline-component.adoc
+++ b/components/camel-twitter/src/main/docs/twitter-timeline-component.adoc
@@ -49,7 +49,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (42 parameters):
+==== Query Parameters (43 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -62,6 +62,7 @@ with the following path and query parameters:
 | *distanceMetric* (consumer) | Used by the non-stream geography search, to search by radius using the configured metrics. The unit can either be mi for miles, or km for kilometers. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. | km | String
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
+| *extendedMode* (consumer) | Used for enabling full text from twitter (eg receive tweets that contains more than 140 characters). | true | boolean
 | *latitude* (consumer) | Used by the non-stream geography search to search by latitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. |  | Double
 | *locations* (consumer) | Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter. A pair is defined as lat,lon. And multiple paris can be separated by semi colon. |  | String
 | *longitude* (consumer) | Used by the non-stream geography search to search by longitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric. |  | Double
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 3c5266a..d7775d0 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
@@ -74,8 +74,8 @@ public class TwitterConfiguration {
     private Double radius;
     @UriParam(label = "consumer,advanced", defaultValue = "km", enums = "km,mi")
     private String distanceMetric;
-    @UriParam(label = "consumer,advanced")
-    private Boolean extendedMode;
+    @UriParam(label = "consumer,advanced", defaultValue = "true")
+    private boolean extendedMode = true;
 
     /**
      * Singleton, on demand instances of Twitter4J's Twitter & TwitterStream.
@@ -111,7 +111,7 @@ public class TwitterConfiguration {
         confBuilder.setOAuthConsumerSecret(consumerSecret);
         confBuilder.setOAuthAccessToken(accessToken);
         confBuilder.setOAuthAccessTokenSecret(accessTokenSecret);
-        confBuilder.setTweetModeExtended(getExtendedMode());
+        confBuilder.setTweetModeExtended(isExtendedMode());
         if (getHttpProxyHost() != null) {
             confBuilder.setHttpProxyHost(getHttpProxyHost());
         }
@@ -400,17 +400,14 @@ public class TwitterConfiguration {
     }
     
     /**
-     * Used for enabling full text from twitter.
-     * <p/>
+     * Used for enabling full text from twitter (eg receive tweets that contains more than 140 characters).
      */
     public void setExtendedMode(Boolean extendedMode) {
-        this.radius = radius;
+        this.extendedMode = extendedMode;
     }
 
-    public Boolean getExtendedMode() {
+    public boolean isExtendedMode() {
         return extendedMode;
     }
-    
-    
 
 }

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.