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 2021/03/31 06:36:50 UTC

[camel] branch master updated (c9649c9 -> cd257f5)

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 c9649c9  Fixed CS
     new 8a714fc  Camel-AWS2-Lambda: Producer operations refactoring - listEventSourceMappings
     new c580074  Fixed CS
     new 5971ab7  Camel-AWS2-Lambda: Producer operations refactoring - deleteEventSourceMapping
     new cd257f5  Fixed CS

The 4 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:
 .../component/aws2/lambda/Lambda2Producer.java     | 53 +++++++++-------------
 1 file changed, 22 insertions(+), 31 deletions(-)

[camel] 01/04: Camel-AWS2-Lambda: Producer operations refactoring - listEventSourceMappings

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 8a714fc40f2bf08cd66b24f8af6de3f579af4fd0
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 31 08:29:47 2021 +0200

    Camel-AWS2-Lambda: Producer operations refactoring - listEventSourceMappings
---
 .../component/aws2/lambda/Lambda2Producer.java     | 25 +++++++---------------
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
index 5caae82..4418a23 100644
--- a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
+++ b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
@@ -458,32 +458,23 @@ public class Lambda2Producer extends DefaultProducer {
     }
 
     private void listEventSourceMapping(LambdaClient lambdaClient, Exchange exchange) throws InvalidPayloadException {
+    	ListEventSourceMappingsRequest request = null;
+    	ListEventSourceMappingsResponse result;
         if (getConfiguration().isPojoRequest()) {
-            Object payload = exchange.getIn().getMandatoryBody();
-            if (payload instanceof ListEventSourceMappingsRequest) {
-                ListEventSourceMappingsResponse result;
-                try {
-                    result = lambdaClient.listEventSourceMappings((ListEventSourceMappingsRequest) payload);
-                } catch (AwsServiceException ase) {
-                    LOG.trace("listEventSourceMapping command returned the error code {}", ase.awsErrorDetails().errorCode());
-                    throw ase;
-                }
-                Message message = getMessageForResponse(exchange);
-                message.setBody(result);
-            }
+            request = exchange.getIn().getMandatoryBody(ListEventSourceMappingsRequest.class);
         } else {
-            ListEventSourceMappingsResponse result;
+                ListEventSourceMappingsRequest.Builder builder = ListEventSourceMappingsRequest.builder();
+                builder.functionName(getEndpoint().getFunction());
+                request = builder.build();
+        }
             try {
-                ListEventSourceMappingsRequest.Builder request
-                        = ListEventSourceMappingsRequest.builder().functionName(getEndpoint().getFunction());
-                result = lambdaClient.listEventSourceMappings(request.build());
+                result = lambdaClient.listEventSourceMappings(request);
             } catch (AwsServiceException ase) {
                 LOG.trace("listEventSourceMapping command returned the error code {}", ase.awsErrorDetails().errorCode());
                 throw ase;
             }
             Message message = getMessageForResponse(exchange);
             message.setBody(result);
-        }
     }
 
     private void listTags(LambdaClient lambdaClient, Exchange exchange) throws InvalidPayloadException {

[camel] 04/04: 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 cd257f56ed156c0742c30f469c97132c061e0b22
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 31 08:36:14 2021 +0200

    Fixed CS
---
 .../camel/component/aws2/lambda/Lambda2Producer.java     | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
index cf0410c..4784e3e 100644
--- a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
+++ b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
@@ -447,14 +447,14 @@ public class Lambda2Producer extends DefaultProducer {
             request = builder.build();
         }
 
-            try {
-                result = lambdaClient.deleteEventSourceMapping(request);
-            } catch (AwsServiceException ase) {
-                LOG.trace("deleteEventSourceMapping command returned the error code {}", ase.awsErrorDetails().errorCode());
-                throw ase;
-            }
-            Message message = getMessageForResponse(exchange);
-            message.setBody(result);
+        try {
+            result = lambdaClient.deleteEventSourceMapping(request);
+        } catch (AwsServiceException ase) {
+            LOG.trace("deleteEventSourceMapping command returned the error code {}", ase.awsErrorDetails().errorCode());
+            throw ase;
+        }
+        Message message = getMessageForResponse(exchange);
+        message.setBody(result);
     }
 
     private void listEventSourceMapping(LambdaClient lambdaClient, Exchange exchange) throws InvalidPayloadException {

[camel] 03/04: Camel-AWS2-Lambda: Producer operations refactoring - deleteEventSourceMapping

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 5971ab71517243e58b5ceb7fe4e560a9b530d8ea
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 31 08:33:01 2021 +0200

    Camel-AWS2-Lambda: Producer operations refactoring - deleteEventSourceMapping
---
 .../java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
index cf7a9d6..cf0410c 100644
--- a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
+++ b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
@@ -445,6 +445,7 @@ public class Lambda2Producer extends DefaultProducer {
                 throw new IllegalArgumentException("Event Source Arn must be specified");
             }
             request = builder.build();
+        }
 
             try {
                 result = lambdaClient.deleteEventSourceMapping(request);
@@ -454,7 +455,6 @@ public class Lambda2Producer extends DefaultProducer {
             }
             Message message = getMessageForResponse(exchange);
             message.setBody(result);
-        }
     }
 
     private void listEventSourceMapping(LambdaClient lambdaClient, Exchange exchange) throws InvalidPayloadException {

[camel] 02/04: 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 c580074df8f7a2fcb0286e3e33517b09e1e7f7fd
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 31 08:32:35 2021 +0200

    Fixed CS
---
 .../component/aws2/lambda/Lambda2Producer.java     | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
index 4418a23..cf7a9d6 100644
--- a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
+++ b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Producer.java
@@ -458,23 +458,23 @@ public class Lambda2Producer extends DefaultProducer {
     }
 
     private void listEventSourceMapping(LambdaClient lambdaClient, Exchange exchange) throws InvalidPayloadException {
-    	ListEventSourceMappingsRequest request = null;
-    	ListEventSourceMappingsResponse result;
+        ListEventSourceMappingsRequest request = null;
+        ListEventSourceMappingsResponse result;
         if (getConfiguration().isPojoRequest()) {
             request = exchange.getIn().getMandatoryBody(ListEventSourceMappingsRequest.class);
         } else {
-                ListEventSourceMappingsRequest.Builder builder = ListEventSourceMappingsRequest.builder();
-                builder.functionName(getEndpoint().getFunction());
-                request = builder.build();
+            ListEventSourceMappingsRequest.Builder builder = ListEventSourceMappingsRequest.builder();
+            builder.functionName(getEndpoint().getFunction());
+            request = builder.build();
         }
-            try {
-                result = lambdaClient.listEventSourceMappings(request);
-            } catch (AwsServiceException ase) {
-                LOG.trace("listEventSourceMapping command returned the error code {}", ase.awsErrorDetails().errorCode());
-                throw ase;
-            }
-            Message message = getMessageForResponse(exchange);
-            message.setBody(result);
+        try {
+            result = lambdaClient.listEventSourceMappings(request);
+        } catch (AwsServiceException ase) {
+            LOG.trace("listEventSourceMapping command returned the error code {}", ase.awsErrorDetails().errorCode());
+            throw ase;
+        }
+        Message message = getMessageForResponse(exchange);
+        message.setBody(result);
     }
 
     private void listTags(LambdaClient lambdaClient, Exchange exchange) throws InvalidPayloadException {