You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/08/07 08:42:44 UTC

[1/3] camel git commit: CAMEL-11635 : corrected wrong groupId in camel examples readme.md and features.xml

Repository: camel
Updated Branches:
  refs/heads/master 5ad1ea411 -> 640547847


CAMEL-11635 : corrected wrong groupId in camel examples readme.md and features.xml


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

Branch: refs/heads/master
Commit: fe79516859474b31a65d6d293244297eeb2c5d3c
Parents: 5ad1ea4
Author: Andrea Tarocchi <at...@redhat.com>
Authored: Fri Aug 4 18:40:21 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Mon Aug 7 10:26:31 2017 +0200

----------------------------------------------------------------------
 examples/camel-example-cdi-osgi/README.md       | 10 ++++-----
 examples/camel-example-cxf-osgi/README.md       |  2 +-
 examples/camel-example-etl/README.md            |  2 +-
 .../src/main/resources/features.xml             |  4 ++--
 examples/camel-example-mybatis/README.md        |  2 +-
 .../src/main/resources/features.xml             |  4 ++--
 examples/camel-example-netty-http/README.md     |  8 +++----
 .../README.md                                   |  8 +++----
 .../README.md                                   |  2 +-
 .../src/main/resources/features.xml             |  2 +-
 examples/camel-example-sql/README.md            | 23 ++++++--------------
 .../src/main/resources/features.xml             |  6 ++---
 examples/camel-example-ssh-security/README.md   |  2 +-
 .../resources/META-INF/feature/features.xml     |  4 ++--
 examples/camel-example-ssh/README.md            |  4 ++--
 .../resources/META-INF/feature/features.xml     |  4 ++--
 .../README.md                                   |  2 +-
 .../src/main/resources/features.xml             |  4 ++--
 .../README.md                                   |  4 ++--
 19 files changed, 44 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-cdi-osgi/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-osgi/README.md b/examples/camel-example-cdi-osgi/README.md
index 8698e8d..eec30d4 100644
--- a/examples/camel-example-cdi-osgi/README.md
+++ b/examples/camel-example-cdi-osgi/README.md
@@ -47,8 +47,8 @@ The Camel application can be stopped pressing <kbd>ctrl</kbd>+<kbd>c</kbd> in th
 
 This example can be executed within Karaf 4.x. Note that it uses
 the `pax-cdi-weld` feature from the PAX CDI version used by Camel and which defines
-the Weld version used. For instance, Camel `2.17.0` depends on PAX CDI `1.0.0.RC1`
-whose `pax-cdi-weld` feature relies on Weld version `2.2.11.Final`.
+the Weld version used. For instance, Camel `${version}` depends on PAX CDI `${pax-cdi-version}`
+and related `pax-cdi-weld` feature.
 
 To run the example, from the command line:
 
@@ -61,15 +61,15 @@ To run the example, from the command line:
 2. Install the pre-requisites:
 
     ```sh
-    karaf@root()> repo-add camel 2.17.0
-    karaf@root()> repo-add activemq 5.13.2
+    karaf@root()> repo-add camel ${version}
+    karaf@root()> repo-add activemq ${activemq-version}
     karaf@root()> feature:install activemq-broker-noweb pax-cdi-weld camel-sjms camel-cdi
     ```
 
 3. Then install and start the example:
 
     ```sh
-    karaf@root()> install -s mvn:org.apache.camel/camel-example-cdi-osgi/2.17.0
+    karaf@root()> install -s mvn:org.apache.camel.example/camel-example-cdi-osgi/${version}
     ```
 
 By tailing the log with:

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-cxf-osgi/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-cxf-osgi/README.md b/examples/camel-example-cxf-osgi/README.md
index cf7d4be..06de99c 100644
--- a/examples/camel-example-cxf-osgi/README.md
+++ b/examples/camel-example-cxf-osgi/README.md
@@ -43,7 +43,7 @@ To run the example on Apache Karaf 4.x or newer
 
 #### Step 3: Deploy the example
 
-	install -s mvn:org.apache.camel/camel-example-cxf-osgi/${version}
+	install -s mvn:org.apache.camel.example/camel-example-cxf-osgi/${version}
 
 #### Step 4: Verify that your service is available using the following url in the browser.
 We assume you're using Karaf's default PAX Web configuration which uses

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-etl/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-etl/README.md b/examples/camel-example-etl/README.md
index 72e51f6..bfc75cf 100644
--- a/examples/camel-example-etl/README.md
+++ b/examples/camel-example-etl/README.md
@@ -41,7 +41,7 @@ from the shell using this example's "features.xml" for easy provisioning.
 
 	feature:repo-add camel ${version}
 	feature:install camel
-	feature:repo-add mvn:org.apache.camel/camel-example-etl/${version}/xml/features
+	feature:repo-add mvn:org.apache.camel.example/camel-example-etl/${version}/xml/features
 	feature:install camel-example-etl
 
 The example outputs logs into the console. When you're done just hit <kbd>ctrl</kbd>+<kbd>d</kbd>

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-etl/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-etl/src/main/resources/features.xml b/examples/camel-example-etl/src/main/resources/features.xml
index d1f1db6..389b504 100644
--- a/examples/camel-example-etl/src/main/resources/features.xml
+++ b/examples/camel-example-etl/src/main/resources/features.xml
@@ -28,7 +28,7 @@
         <feature version="${project.version}">camel-spring</feature>
         <bundle>mvn:org.apache.derby/derby/${derby-version}</bundle>
         <bundle>mvn:org.apache.openjpa/openjpa/${openjpa-version}</bundle>
-        <bundle>mvn:org.apache.camel/camel-example-etl/${project.version}</bundle>
+        <bundle>mvn:org.apache.camel.example/camel-example-etl/${project.version}</bundle>
     </feature>
 
-</features>
\ No newline at end of file
+</features>

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-mybatis/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-mybatis/README.md b/examples/camel-example-mybatis/README.md
index 95dec63..99b4ad3 100644
--- a/examples/camel-example-mybatis/README.md
+++ b/examples/camel-example-mybatis/README.md
@@ -26,7 +26,7 @@ for easy provisioning.
 
 	feature:repo-add camel ${version}
 	feature:install camel
-	feature:repo-add mvn:org.apache.camel/camel-example-mybatis/${version}/xml/features
+	feature:repo-add mvn:org.apache.camel.example/camel-example-mybatis/${version}/xml/features
 	feature:install camel-example-mybatis
 
 And you can see the application running by tailing the logs

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-mybatis/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-mybatis/src/main/resources/features.xml b/examples/camel-example-mybatis/src/main/resources/features.xml
index 81b03f4..e70086e 100644
--- a/examples/camel-example-mybatis/src/main/resources/features.xml
+++ b/examples/camel-example-mybatis/src/main/resources/features.xml
@@ -25,7 +25,7 @@
         <feature version="${project.version}">camel-blueprint</feature>
         <feature version="${project.version}">camel-mybatis</feature>
         <bundle>mvn:org.apache.derby/derby/${derby-version}</bundle>
-        <bundle>mvn:org.apache.camel/camel-example-mybatis/${project.version}</bundle>
+        <bundle>mvn:org.apache.camel.example/camel-example-mybatis/${project.version}</bundle>
     </feature>
 
-</features>
\ No newline at end of file
+</features>

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-netty-http/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-netty-http/README.md b/examples/camel-example-netty-http/README.md
index d87e381..968b05b 100644
--- a/examples/camel-example-netty-http/README.md
+++ b/examples/camel-example-netty-http/README.md
@@ -23,7 +23,7 @@ $ mvn install
 This example runs in Apache Karaf / ServiceMix. To install Apache Camel in Karaf you type in the shell:
 
 ```sh
-karaf@root()> repo-add camel 2.17.0
+karaf@root()> repo-add camel ${version}
 karaf@root()> feature:install camel
 ```
 
@@ -41,14 +41,14 @@ The port number can be changed by editing the following source file:
 In the Apache Karaf / ServiceMix shell type:
 
 ```sh
-karaf@root()> install -s mvn:org.apache.camel/camel-example-netty-http-shared/2.17.0
+karaf@root()> install -s mvn:org.apache.camel.example/camel-example-netty-http-shared/${version}
 ```
 
 Then you can install the Camel applications:
 
 ```sh
-karaf@root()> install -s mvn:org.apache.camel/camel-example-netty-myapp-one/2.17.0
-karaf@root()> install -s mvn:org.apache.camel/camel-example-netty-myapp-two/2.17.0
+karaf@root()> install -s mvn:org.apache.camel.example/camel-example-netty-myapp-one/${version}
+karaf@root()> install -s mvn:org.apache.camel.example/camel-example-netty-myapp-two/${version}
 ```
 
 From a web browser you can then try the example by accessing the followign URLs:

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-reportincident-wssecurity/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-reportincident-wssecurity/README.md b/examples/camel-example-reportincident-wssecurity/README.md
index 78f0d2e..1268bec 100644
--- a/examples/camel-example-reportincident-wssecurity/README.md
+++ b/examples/camel-example-reportincident-wssecurity/README.md
@@ -47,16 +47,16 @@ To run the example on Apache Karaf 4.x
 	feature:install camel-cxf
 	feature:install camel-mail
 	feature:install camel-velocity
-        feature:install cxf-bindings-corba
-        feature:install cxf-transports-jms
-        feature:install cxf-ws-security
+  feature:install cxf-bindings-corba
+  feature:install cxf-transports-jms
+  feature:install cxf-ws-security
 
   remark: As the camel route sends email to a SMTP server, you must configure a user/password in your favorite
           SMTP Server (James by example). User = someone and password = secret
 
 #### Step 3: Deploy our example
 
-	install -s mvn:org.apache.camel/camel-example-reportincident-wssecurity/${project.version}
+	install -s mvn:org.apache.camel.example/camel-example-reportincident-wssecurity/${project.version}
 
 #### Step 4: Verify that your service is available using in the browser the following url
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-servlet-rest-blueprint/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-servlet-rest-blueprint/README.md b/examples/camel-example-servlet-rest-blueprint/README.md
index e4737ce..16742d4 100644
--- a/examples/camel-example-servlet-rest-blueprint/README.md
+++ b/examples/camel-example-servlet-rest-blueprint/README.md
@@ -25,7 +25,7 @@ First you need to install the following features in Karaf/ServiceMix with:
 
 Then you can install the Camel example:
 
-	install -s mvn:org.apache.camel/camel-example-servlet-rest-blueprint/${project.version}
+	install -s mvn:org.apache.camel.example/camel-example-servlet-rest-blueprint/${project.version}
 
 And you can see the application running by tailing the logs
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-sql-blueprint/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-sql-blueprint/src/main/resources/features.xml b/examples/camel-example-sql-blueprint/src/main/resources/features.xml
index cd3cc7b..a069cfc 100644
--- a/examples/camel-example-sql-blueprint/src/main/resources/features.xml
+++ b/examples/camel-example-sql-blueprint/src/main/resources/features.xml
@@ -26,7 +26,7 @@
         <feature version="${project.version}">camel-sql</feature>
         <bundle>mvn:org.apache.derby/derby/${derby-version}</bundle>
         <bundle>mvn:org.apache.commons/commons-pool2/${commons-pool2-version}</bundle>
-        <bundle>wrap:mvn:org.apache.commons/commons-dbcp2/2.1.1$overwrite=merge&amp;DynamicImport-Package=*</bundle>
+        <bundle>wrap:mvn:org.apache.commons/commons-dbcp2/${commons-dbcp2-version}$overwrite=merge&amp;DynamicImport-Package=*</bundle>
         <bundle>mvn:org.apache.camel.example/camel-example-sql-blueprint/${project.version}</bundle>
     </feature>
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-sql/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-sql/README.md b/examples/camel-example-sql/README.md
index 455868d..e9a1b2b 100644
--- a/examples/camel-example-sql/README.md
+++ b/examples/camel-example-sql/README.md
@@ -29,26 +29,17 @@ as well the CamelContext. You can see this in the following file:
 In the src/main/resources/META-INF/spring/camel-context.xml
 
 ### Run with Karaf
+You will need to install this example first to your local maven repository with:
 
-To install Apache Camel in Karaf you type in the shell (we use version ${project.version}):
+	mvn install
+
+Then you can install this example from the shell using this example's `features.xml`
+for easy provisioning:
 
 	feature:repo-add camel ${project.version}
 	feature:install camel
-
-First you need to install the following features in Karaf/ServiceMix with:
-
-	feature:install camel-spring
-	feature:install camel-sql
-
-Then you need to install JDBC connection pool and the Derby Database:
-
-	install -s mvn:commons-pool/commons-pool/1.6
-	install -s mvn:commons-dbcp/commons-dbcp/1.4
-	install -s mvn:org.apache.derby/derby/10.10.1.1
-
-Then you can install the Camel example:
-
-	install -s mvn:org.apache.camel/camel-example-sql/${project.version}
+  feature:repo-add mvn:org.apache.camel.example/camel-example-sql/${version}/xml/features
+  feature:install camel-example-sql
 
 And you can see the application running by tailing the logs
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-sql/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-sql/src/main/resources/features.xml b/examples/camel-example-sql/src/main/resources/features.xml
index bd6d54b..905ce8e 100644
--- a/examples/camel-example-sql/src/main/resources/features.xml
+++ b/examples/camel-example-sql/src/main/resources/features.xml
@@ -25,9 +25,9 @@
         <feature version="${project.version}">camel-spring</feature>
         <feature version="${project.version}">camel-sql</feature>
         <bundle>mvn:org.apache.derby/derby/${derby-version}</bundle>
-        <bundle>mvn:commons-pool/commons-pool/${commons-pool-version}</bundle>
-        <bundle>mvn:org.apache.commons/commons-dbcp2/${commons-dbcp2-version}</bundle>
-        <bundle>mvn:org.apache.camel/camel-example-sql/${project.version}</bundle>
+        <bundle>mvn:org.apache.commons/commons-pool2/${commons-pool2-version}</bundle>
+        <bundle>wrap:mvn:org.apache.commons/commons-dbcp2/${commons-dbcp2-version}$overwrite=merge&amp;DynamicImport-Package=*</bundle>
+        <bundle>mvn:org.apache.camel.example/camel-example-sql/${project.version}</bundle>
     </feature>
 
 </features>

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-ssh-security/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-ssh-security/README.md b/examples/camel-example-ssh-security/README.md
index 126c864..9051ee2 100644
--- a/examples/camel-example-ssh-security/README.md
+++ b/examples/camel-example-ssh-security/README.md
@@ -78,7 +78,7 @@ the `<karaf_home>` directory.
 From the running Karaf console, run the following commands to install this example into your
 running Karaf server.
 
-    feature:repo-add mvn:org.apache.camel/camel-example-ssh-security/<camel version>/xml/features
+    feature:repo-add mvn:org.apache.camel.example/camel-example-ssh-security/${version}/xml/features
     feature:install camel-example-ssh-security
 
 This example outputs into the Karaf log file so you can either `tail -f <karaf_home>data/log/karaf.log`

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-ssh-security/src/main/resources/META-INF/feature/features.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-ssh-security/src/main/resources/META-INF/feature/features.xml b/examples/camel-example-ssh-security/src/main/resources/META-INF/feature/features.xml
index 97927c6..25def80 100644
--- a/examples/camel-example-ssh-security/src/main/resources/META-INF/feature/features.xml
+++ b/examples/camel-example-ssh-security/src/main/resources/META-INF/feature/features.xml
@@ -26,6 +26,6 @@
   <feature name="camel-example-ssh-security" version="${project.version}">
     <feature version="${project.version}">camel-ssh</feature>
     <feature version="${project.version}">camel-spring</feature>
-    <bundle>mvn:org.apache.camel/camel-example-ssh-security/${project.version}</bundle>
+    <bundle>mvn:org.apache.camel.example/camel-example-ssh-security/${project.version}</bundle>
   </feature>
-</features>
\ No newline at end of file
+</features>

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-ssh/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-ssh/README.md b/examples/camel-example-ssh/README.md
index 93f3219..1813ba0 100644
--- a/examples/camel-example-ssh/README.md
+++ b/examples/camel-example-ssh/README.md
@@ -23,8 +23,8 @@ To stop the example hit <kbd>ctrl</kbd>+<kbd>c</kbd>
 If using Apache Karaf / Apache ServiceMix you can install this example
 from the shell
 
-	feature:repo-add camel <camel version>
-	feature:repo-add mvn:org.apache.camel/camel-example-ssh/<camel version>/xml/features
+	feature:repo-add camel ${version}
+	feature:repo-add mvn:org.apache.camel.example/camel-example-ssh/${version}/xml/features
 	feature:install camel-example-ssh
 
 ### Forum, Help, etc

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-ssh/src/main/resources/META-INF/feature/features.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-ssh/src/main/resources/META-INF/feature/features.xml b/examples/camel-example-ssh/src/main/resources/META-INF/feature/features.xml
index 1c148a2..d4e2e0b 100644
--- a/examples/camel-example-ssh/src/main/resources/META-INF/feature/features.xml
+++ b/examples/camel-example-ssh/src/main/resources/META-INF/feature/features.xml
@@ -26,6 +26,6 @@
   <feature name="camel-example-ssh" version="${project.version}">
     <feature version="${project.version}">camel-ssh</feature>
     <feature version="${project.version}">camel-spring</feature>
-    <bundle>mvn:org.apache.camel/camel-example-ssh/${project.version}</bundle>
+    <bundle>mvn:org.apache.camel.examples/camel-example-ssh/${project.version}</bundle>
   </feature>
-</features>
\ No newline at end of file
+</features>

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-transformer-blueprint/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-transformer-blueprint/README.md b/examples/camel-example-transformer-blueprint/README.md
index 6234932..e405352 100644
--- a/examples/camel-example-transformer-blueprint/README.md
+++ b/examples/camel-example-transformer-blueprint/README.md
@@ -34,7 +34,7 @@ To run the example on the karaf container
 
 #### Step 3: Deploy
 
-    feature:repo-add mvn:org.apache.camel/camel-example-transformer-blueprint/${version}/xml/features
+    feature:repo-add mvn:org.apache.camel.example/camel-example-transformer-blueprint/${version}/xml/features
     feature:install camel-example-transformer-blueprint
 
 #### Step 4: Check the output

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-transformer-blueprint/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-transformer-blueprint/src/main/resources/features.xml b/examples/camel-example-transformer-blueprint/src/main/resources/features.xml
index ebd418a..420fef6 100644
--- a/examples/camel-example-transformer-blueprint/src/main/resources/features.xml
+++ b/examples/camel-example-transformer-blueprint/src/main/resources/features.xml
@@ -19,13 +19,13 @@
 -->
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="camel-example-transformer-blueprint">
     <repository>mvn:org.apache.camel.karaf/apache-camel/${project.version}/xml/features</repository>
-    
+
     <feature name='camel-example-transformer-blueprint' version='${project.version}'>
         <feature version="${project.version}">camel</feature>
         <feature version="${project.version}">camel-blueprint</feature>
         <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xalan/${xalan-bundle-version}</bundle>
         <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcel/${bcel-bundle-version}</bundle>
-        <bundle>mvn:org.apache.camel/camel-example-transformer-blueprint/${project.version}</bundle>
+        <bundle>mvn:org.apache.camel.example/camel-example-transformer-blueprint/${project.version}</bundle>
     </feature>
 
 </features>

http://git-wip-us.apache.org/repos/asf/camel/blob/fe795168/examples/camel-example-twitter-websocket-blueprint/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-twitter-websocket-blueprint/README.md b/examples/camel-example-twitter-websocket-blueprint/README.md
index fd7c05e..ab9e9d1 100644
--- a/examples/camel-example-twitter-websocket-blueprint/README.md
+++ b/examples/camel-example-twitter-websocket-blueprint/README.md
@@ -22,7 +22,7 @@ This example requires running in Apache Karaf / ServiceMix
 To install Apache Camel in Karaf you type in the shell (as an example here we make use of
 Camel version 2.18.1):
 
-	feature:repo-add camel 2.18.1
+	feature:repo-add camel ${version}
 
 First you need to install the following features in Karaf/ServiceMix with:
 
@@ -32,7 +32,7 @@ First you need to install the following features in Karaf/ServiceMix with:
 
 Then you can install the Camel example:
 
-	install -s mvn:org.apache.camel/camel-example-twitter-websocket-blueprint/2.18.1
+	install -s mvn:org.apache.camel.example/camel-example-twitter-websocket-blueprint/${version}
 
 Then open a browser to see live twitter updates in the web page
 


[3/3] camel git commit: CAMEL-11642 - Fixed CS and use ObjectHelper

Posted by ac...@apache.org.
CAMEL-11642 - Fixed CS and use ObjectHelper


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

Branch: refs/heads/master
Commit: 6405478479652a6b5b4efabaccbab7d433fcf3a4
Parents: 9c7a8f3
Author: Andrea Cosentino <an...@gmail.com>
Authored: Mon Aug 7 10:36:40 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Mon Aug 7 10:37:19 2017 +0200

----------------------------------------------------------------------
 components/camel-paho/src/main/docs/paho-component.adoc        | 6 +++---
 .../java/org/apache/camel/component/paho/PahoEndpoint.java     | 3 ++-
 .../org/apache/camel/component/paho/PahoComponentTest.java     | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/64054784/components/camel-paho/src/main/docs/paho-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-paho/src/main/docs/paho-component.adoc b/components/camel-paho/src/main/docs/paho-component.adoc
index 84083ee..59197c8 100644
--- a/components/camel-paho/src/main/docs/paho-component.adoc
+++ b/components/camel-paho/src/main/docs/paho-component.adoc
@@ -127,8 +127,6 @@ The Paho component supports 4 options which are listed below.
 | **brokerUrl** (common) | The URL of the MQTT broker. |  | String
 | **clientId** (common) | MQTT client identifier. |  | String
 | **connectOptions** (advanced) | Client connection options |  | MqttConnectOptions
-| **userName** (common) | UserName used for authentication again the MQTT broker. |  | String
-| **password** (common) | Password used for authentication again the MQTT broker. |  | String
 | **resolveProperty Placeholders** (advanced) | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | boolean
 |=======================================================================
 // component options: END
@@ -149,7 +147,7 @@ with the following path and query parameters:
 | **topic** | *Required* Name of the topic |  | String
 |=======================================================================
 
-#### Query Parameters (12 parameters):
+#### Query Parameters (14 parameters):
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |=======================================================================
@@ -159,9 +157,11 @@ with the following path and query parameters:
 | **clientId** (common) | MQTT client identifier. |  | String
 | **connectOptions** (common) | Client connection options |  | MqttConnectOptions
 | **filePersistenceDirectory** (common) | Base directory used by the file persistence provider. |  | String
+| **password** (common) | Password to be used for authentication against the MQTT broker |  | String
 | **persistence** (common) | Client persistence to be used - memory or file. | MEMORY | PahoPersistence
 | **qos** (common) | Client quality of service level (0-2). | 2 | int
 | **retained** (common) | Retain option | false | boolean
+| **userName** (common) | Username to be used for authentication against the MQTT broker |  | String
 | **bridgeErrorHandler** (consumer) | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN or ERROR level and ignored. | false | boolean
 | **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

http://git-wip-us.apache.org/repos/asf/camel/blob/64054784/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
index 3416ea8..8d858d5 100644
--- a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
+++ b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
@@ -28,6 +28,7 @@ import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
+import org.apache.camel.util.ObjectHelper;
 import org.eclipse.paho.client.mqttv3.MqttClient;
 import org.eclipse.paho.client.mqttv3.MqttClientPersistence;
 import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
@@ -146,7 +147,7 @@ public class PahoEndpoint extends DefaultEndpoint {
         MqttConnectOptions options = new MqttConnectOptions();
         options.setAutomaticReconnect(autoReconnect);
         
-        if(!"".equals(userName) && !"".equals(password)) {
+        if (ObjectHelper.isNotEmpty(userName) && ObjectHelper.isNotEmpty(password)) {
             options.setUserName(userName);
             options.setPassword(password.toCharArray());
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/64054784/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
index f7de2c7..503b79f 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
@@ -217,7 +217,7 @@ public class PahoComponentTest extends CamelTestSupport {
         mock.expectedMessageCount(0);
 
         // When
-        template.sendBody("paho:someRandomQueue?brokerUrl=tcp://localhost:" + mqttPort+"&userName=test&password=test", "msg");
+        template.sendBody("paho:someRandomQueue?brokerUrl=tcp://localhost:" + mqttPort + "&userName=test&password=test", "msg");
 
         // Then
         mock.assertIsSatisfied();


[2/3] camel git commit: CAMEL-11642 - Broker Credentials should be set from endpoint

Posted by ac...@apache.org.
CAMEL-11642 - Broker Credentials should be set from endpoint


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

Branch: refs/heads/master
Commit: 9c7a8f308ce845aab89b0e08cce3ab7babf08cfa
Parents: fe79516
Author: Fabrizio Spataro <fa...@bizmate.it>
Authored: Mon Aug 7 10:07:27 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Mon Aug 7 10:27:40 2017 +0200

----------------------------------------------------------------------
 .../src/main/docs/paho-component.adoc           |  4 +--
 .../camel/component/paho/PahoComponent.java     |  2 +-
 .../camel/component/paho/PahoEndpoint.java      | 34 ++++++++++++++++++++
 .../camel/component/paho/PahoComponentTest.java | 12 +++++++
 4 files changed, 49 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9c7a8f30/components/camel-paho/src/main/docs/paho-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-paho/src/main/docs/paho-component.adoc b/components/camel-paho/src/main/docs/paho-component.adoc
index 2c20f19..84083ee 100644
--- a/components/camel-paho/src/main/docs/paho-component.adoc
+++ b/components/camel-paho/src/main/docs/paho-component.adoc
@@ -127,13 +127,13 @@ The Paho component supports 4 options which are listed below.
 | **brokerUrl** (common) | The URL of the MQTT broker. |  | String
 | **clientId** (common) | MQTT client identifier. |  | String
 | **connectOptions** (advanced) | Client connection options |  | MqttConnectOptions
+| **userName** (common) | UserName used for authentication again the MQTT broker. |  | String
+| **password** (common) | Password used for authentication again the MQTT broker. |  | String
 | **resolveProperty Placeholders** (advanced) | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | boolean
 |=======================================================================
 // component options: END
 
 
-
-
 // endpoint options: START
 The Paho endpoint is configured using URI syntax:
 

http://git-wip-us.apache.org/repos/asf/camel/blob/9c7a8f30/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoComponent.java b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoComponent.java
index 1a8e4a5..47cb4fe 100644
--- a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoComponent.java
+++ b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoComponent.java
@@ -32,7 +32,7 @@ public class PahoComponent extends UriEndpointComponent {
     private String clientId;
     @Metadata(label = "advanced")
     private MqttConnectOptions connectOptions;
-
+    
     public PahoComponent() {
         super(PahoEndpoint.class);
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/9c7a8f30/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
index 16af7d1..3416ea8 100644
--- a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
+++ b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
@@ -63,6 +63,11 @@ public class PahoEndpoint extends DefaultEndpoint {
     private String filePersistenceDirectory;
     @UriParam(defaultValue = "true")
     private boolean autoReconnect = true; 
+    @UriParam @Metadata(secret = true)
+    private String userName; 
+    @UriParam @Metadata(secret = true)
+    private String password; 
+    
 
     // Collaboration members
     @UriParam
@@ -140,6 +145,11 @@ public class PahoEndpoint extends DefaultEndpoint {
         
         MqttConnectOptions options = new MqttConnectOptions();
         options.setAutomaticReconnect(autoReconnect);
+        
+        if(!"".equals(userName) && !"".equals(password)) {
+            options.setUserName(userName);
+            options.setPassword(password.toCharArray());
+        }
         return options;
     }
 
@@ -271,4 +281,28 @@ public class PahoEndpoint extends DefaultEndpoint {
         this.autoReconnect = autoReconnect;
     }
 
+    public String getUserName() {
+        return userName;
+    }
+
+    /**
+     * Username to be used for authentication against the MQTT broker
+     * @param userName
+     */
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    /**
+     * Password to be used for authentication against the MQTT broker
+     * @param password
+     */
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/9c7a8f30/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
index 27f0ed8..f7de2c7 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
@@ -211,4 +211,16 @@ public class PahoComponentTest extends CamelTestSupport {
         testCustomizedPahoMock.assertIsSatisfied();
     }
 
+    @Test
+    public void shouldNotSendMessageAuthIsNotValid() throws InterruptedException {
+        // Given
+        mock.expectedMessageCount(0);
+
+        // When
+        template.sendBody("paho:someRandomQueue?brokerUrl=tcp://localhost:" + mqttPort+"&userName=test&password=test", "msg");
+
+        // Then
+        mock.assertIsSatisfied();
+    }
+    
 }