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 2020/03/17 15:05:51 UTC

[camel] branch master updated (6d8692a -> 70a2218)

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

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 6d8692a  Upgrade Rxjava to version 2.2.19
     new 1e9475d  Camel-AWS2-EC2: Cleanup
     new 29b37e5  Camel-AWS2-EC2: More Cleanup
     new 70a2218  Camel-AWS2-EC2: Fixed CS

The 3 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/component/aws2/ec2/AWS2EC2Producer.java  | 36 ++++++++++++++--------
 .../aws2/ec2/EC2ComponentClientRegistryTest.java   |  2 +-
 2 files changed, 25 insertions(+), 13 deletions(-)


[camel] 02/03: Camel-AWS2-EC2: More Cleanup

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 29b37e548e183a802c378d0d6ae743bab24f8726
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 17 16:02:49 2020 +0100

    Camel-AWS2-EC2: More Cleanup
---
 .../apache/camel/component/aws2/ec2/EC2ComponentClientRegistryTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentClientRegistryTest.java b/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentClientRegistryTest.java
index 0c5f311..147029c 100644
--- a/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentClientRegistryTest.java
+++ b/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentClientRegistryTest.java
@@ -40,7 +40,7 @@ public class EC2ComponentClientRegistryTest extends CamelTestSupport {
 
         AWS2EC2Component component = context.getComponent("aws2-ec2", AWS2EC2Component.class);
         assertThrows(IllegalArgumentException.class, () -> {
-            AWS2EC2Endpoint endpoint = (AWS2EC2Endpoint)component.createEndpoint("aws-ec2://TestDomain");
+            component.createEndpoint("aws-ec2://TestDomain");
         });
     }
 }


[camel] 03/03: Camel-AWS2-EC2: Fixed CS

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 70a2218344857f45b68dc68062c3a820e4a79f39
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 17 16:05:19 2020 +0100

    Camel-AWS2-EC2: Fixed CS
---
 .../camel/component/aws2/ec2/AWS2EC2Producer.java  | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java b/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java
index 18fa9a4..5dd7584 100644
--- a/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java
+++ b/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java
@@ -136,7 +136,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings({ "rawtypes", "unchecked" })
-	private void createAndRunInstance(Ec2Client ec2Client, Exchange exchange) {
+    private void createAndRunInstance(Ec2Client ec2Client, Exchange exchange) {
         String ami;
         InstanceType instanceType;
         RunInstancesRequest.Builder builder = RunInstancesRequest.builder();
@@ -211,7 +211,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings("unchecked")
-	private void startInstances(Ec2Client ec2Client, Exchange exchange) {
+    private void startInstances(Ec2Client ec2Client, Exchange exchange) {
         Collection<String> instanceIds;
         StartInstancesRequest.Builder builder = StartInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
@@ -233,7 +233,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings("unchecked")
-	private void stopInstances(Ec2Client ec2Client, Exchange exchange) {
+    private void stopInstances(Ec2Client ec2Client, Exchange exchange) {
         Collection<String> instanceIds;
         StopInstancesRequest.Builder builder = StopInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
@@ -255,7 +255,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings("unchecked")
-	private void terminateInstances(Ec2Client ec2Client, Exchange exchange) {
+    private void terminateInstances(Ec2Client ec2Client, Exchange exchange) {
         Collection<String> instanceIds;
         TerminateInstancesRequest.Builder builder = TerminateInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
@@ -277,7 +277,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings("unchecked")
-	private void describeInstances(Ec2Client ec2Client, Exchange exchange) {
+    private void describeInstances(Ec2Client ec2Client, Exchange exchange) {
         Collection<String> instanceIds;
         DescribeInstancesRequest.Builder builder = DescribeInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
@@ -296,7 +296,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings("unchecked")
-	private void describeInstancesStatus(Ec2Client ec2Client, Exchange exchange) {
+    private void describeInstancesStatus(Ec2Client ec2Client, Exchange exchange) {
         Collection<String> instanceIds;
         DescribeInstanceStatusRequest.Builder builder = DescribeInstanceStatusRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
@@ -315,7 +315,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings("unchecked")
-	private void rebootInstances(Ec2Client ec2Client, Exchange exchange) {
+    private void rebootInstances(Ec2Client ec2Client, Exchange exchange) {
         Collection<String> instanceIds;
         RebootInstancesRequest.Builder builder = RebootInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
@@ -334,7 +334,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings("unchecked")
-	private void monitorInstances(Ec2Client ec2Client, Exchange exchange) {
+    private void monitorInstances(Ec2Client ec2Client, Exchange exchange) {
         Collection<String> instanceIds;
         MonitorInstancesRequest.Builder builder = MonitorInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
@@ -356,7 +356,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings("unchecked")
-	private void unmonitorInstances(Ec2Client ec2Client, Exchange exchange) {
+    private void unmonitorInstances(Ec2Client ec2Client, Exchange exchange) {
         Collection<String> instanceIds;
         UnmonitorInstancesRequest.Builder builder = UnmonitorInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
@@ -378,7 +378,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings("unchecked")
-	private void createTags(Ec2Client ec2Client, Exchange exchange) {
+    private void createTags(Ec2Client ec2Client, Exchange exchange) {
         Collection<String> instanceIds;
         Collection<Tag> tags;
         CreateTagsRequest.Builder builder = CreateTagsRequest.builder();
@@ -407,7 +407,7 @@ public class AWS2EC2Producer extends DefaultProducer {
     }
 
     @SuppressWarnings("unchecked")
-	private void deleteTags(Ec2Client ec2Client, Exchange exchange) {
+    private void deleteTags(Ec2Client ec2Client, Exchange exchange) {
         Collection<String> instanceIds;
         Collection<Tag> tags;
         DeleteTagsRequest.Builder builder = DeleteTagsRequest.builder();


[camel] 01/03: Camel-AWS2-EC2: Cleanup

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 1e9475d0a4b5eaa088ca182537ee6dea326536ee
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 17 16:00:36 2020 +0100

    Camel-AWS2-EC2: Cleanup
---
 .../camel/component/aws2/ec2/AWS2EC2Producer.java  | 58 +++++++++++++---------
 1 file changed, 35 insertions(+), 23 deletions(-)

diff --git a/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java b/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java
index 000c4f3..18fa9a4 100644
--- a/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java
+++ b/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java
@@ -49,6 +49,7 @@ import software.amazon.awssdk.services.ec2.model.StartInstancesRequest;
 import software.amazon.awssdk.services.ec2.model.StartInstancesResponse;
 import software.amazon.awssdk.services.ec2.model.StopInstancesRequest;
 import software.amazon.awssdk.services.ec2.model.StopInstancesResponse;
+import software.amazon.awssdk.services.ec2.model.Tag;
 import software.amazon.awssdk.services.ec2.model.TerminateInstancesRequest;
 import software.amazon.awssdk.services.ec2.model.TerminateInstancesResponse;
 import software.amazon.awssdk.services.ec2.model.UnmonitorInstancesRequest;
@@ -134,7 +135,8 @@ public class AWS2EC2Producer extends DefaultProducer {
         return (AWS2EC2Endpoint)super.getEndpoint();
     }
 
-    private void createAndRunInstance(Ec2Client ec2Client, Exchange exchange) {
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+	private void createAndRunInstance(Ec2Client ec2Client, Exchange exchange) {
         String ami;
         InstanceType instanceType;
         RunInstancesRequest.Builder builder = RunInstancesRequest.builder();
@@ -208,8 +210,9 @@ public class AWS2EC2Producer extends DefaultProducer {
         message.setBody(result);
     }
 
-    private void startInstances(Ec2Client ec2Client, Exchange exchange) {
-        Collection instanceIds;
+    @SuppressWarnings("unchecked")
+	private void startInstances(Ec2Client ec2Client, Exchange exchange) {
+        Collection<String> instanceIds;
         StartInstancesRequest.Builder builder = StartInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
             instanceIds = exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS, Collection.class);
@@ -229,8 +232,9 @@ public class AWS2EC2Producer extends DefaultProducer {
         message.setBody(result);
     }
 
-    private void stopInstances(Ec2Client ec2Client, Exchange exchange) {
-        Collection instanceIds;
+    @SuppressWarnings("unchecked")
+	private void stopInstances(Ec2Client ec2Client, Exchange exchange) {
+        Collection<String> instanceIds;
         StopInstancesRequest.Builder builder = StopInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
             instanceIds = exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS, Collection.class);
@@ -250,8 +254,9 @@ public class AWS2EC2Producer extends DefaultProducer {
         message.setBody(result);
     }
 
-    private void terminateInstances(Ec2Client ec2Client, Exchange exchange) {
-        Collection instanceIds;
+    @SuppressWarnings("unchecked")
+	private void terminateInstances(Ec2Client ec2Client, Exchange exchange) {
+        Collection<String> instanceIds;
         TerminateInstancesRequest.Builder builder = TerminateInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
             instanceIds = exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS, Collection.class);
@@ -271,8 +276,9 @@ public class AWS2EC2Producer extends DefaultProducer {
         message.setBody(result);
     }
 
-    private void describeInstances(Ec2Client ec2Client, Exchange exchange) {
-        Collection instanceIds;
+    @SuppressWarnings("unchecked")
+	private void describeInstances(Ec2Client ec2Client, Exchange exchange) {
+        Collection<String> instanceIds;
         DescribeInstancesRequest.Builder builder = DescribeInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
             instanceIds = exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS, Collection.class);
@@ -289,8 +295,9 @@ public class AWS2EC2Producer extends DefaultProducer {
         message.setBody(result);
     }
 
-    private void describeInstancesStatus(Ec2Client ec2Client, Exchange exchange) {
-        Collection instanceIds;
+    @SuppressWarnings("unchecked")
+	private void describeInstancesStatus(Ec2Client ec2Client, Exchange exchange) {
+        Collection<String> instanceIds;
         DescribeInstanceStatusRequest.Builder builder = DescribeInstanceStatusRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
             instanceIds = exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS, Collection.class);
@@ -307,8 +314,9 @@ public class AWS2EC2Producer extends DefaultProducer {
         message.setBody(result);
     }
 
-    private void rebootInstances(Ec2Client ec2Client, Exchange exchange) {
-        Collection instanceIds;
+    @SuppressWarnings("unchecked")
+	private void rebootInstances(Ec2Client ec2Client, Exchange exchange) {
+        Collection<String> instanceIds;
         RebootInstancesRequest.Builder builder = RebootInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
             instanceIds = exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS, Collection.class);
@@ -325,8 +333,9 @@ public class AWS2EC2Producer extends DefaultProducer {
         }
     }
 
-    private void monitorInstances(Ec2Client ec2Client, Exchange exchange) {
-        Collection instanceIds;
+    @SuppressWarnings("unchecked")
+	private void monitorInstances(Ec2Client ec2Client, Exchange exchange) {
+        Collection<String> instanceIds;
         MonitorInstancesRequest.Builder builder = MonitorInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
             instanceIds = exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS, Collection.class);
@@ -346,8 +355,9 @@ public class AWS2EC2Producer extends DefaultProducer {
         message.setBody(result);
     }
 
-    private void unmonitorInstances(Ec2Client ec2Client, Exchange exchange) {
-        Collection instanceIds;
+    @SuppressWarnings("unchecked")
+	private void unmonitorInstances(Ec2Client ec2Client, Exchange exchange) {
+        Collection<String> instanceIds;
         UnmonitorInstancesRequest.Builder builder = UnmonitorInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
             instanceIds = exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS, Collection.class);
@@ -367,9 +377,10 @@ public class AWS2EC2Producer extends DefaultProducer {
         message.setBody(result);
     }
 
-    private void createTags(Ec2Client ec2Client, Exchange exchange) {
-        Collection instanceIds;
-        Collection tags;
+    @SuppressWarnings("unchecked")
+	private void createTags(Ec2Client ec2Client, Exchange exchange) {
+        Collection<String> instanceIds;
+        Collection<Tag> tags;
         CreateTagsRequest.Builder builder = CreateTagsRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
             instanceIds = exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS, Collection.class);
@@ -395,9 +406,10 @@ public class AWS2EC2Producer extends DefaultProducer {
         message.setBody(result);
     }
 
-    private void deleteTags(Ec2Client ec2Client, Exchange exchange) {
-        Collection instanceIds;
-        Collection tags;
+    @SuppressWarnings("unchecked")
+	private void deleteTags(Ec2Client ec2Client, Exchange exchange) {
+        Collection<String> instanceIds;
+        Collection<Tag> tags;
         DeleteTagsRequest.Builder builder = DeleteTagsRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS))) {
             instanceIds = exchange.getIn().getHeader(AWS2EC2Constants.INSTANCES_IDS, Collection.class);