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 2018/01/25 10:13:00 UTC

[camel] branch master updated (39b0bff -> 0961821)

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 39b0bff  CAMEL-12193: ThrowException DSL should support no-arg constructors
     new 1739ca6  CAMEL-12190 - Camel-AWS S3: Add a parameter to specify chunkedEncodingDisabled option
     new 0961821  CAMEL-12190 - Camel-AWS S3: Add a parameter to specify chunkedEncodingDisabled option - regen docs and fixed CS

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:
 components/camel-aws/src/main/docs/aws-s3-component.adoc   |  3 ++-
 .../org/apache/camel/component/aws/s3/S3Configuration.java | 14 ++++++++++++++
 .../java/org/apache/camel/component/aws/s3/S3Endpoint.java |  6 +++++-
 .../component/aws/s3/S3ComponentConfigurationTest.java     | 13 +++++++++++++
 .../component/aws/s3/S3ComponentVerifierExtensionTest.java |  2 --
 .../aws/swf/SwfComponentVerifierExtensionTest.java         |  1 -
 .../aws/s3/springboot/S3ComponentConfiguration.java        | 12 ++++++++++++
 7 files changed, 46 insertions(+), 5 deletions(-)

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

[camel] 01/02: CAMEL-12190 - Camel-AWS S3: Add a parameter to specify chunkedEncodingDisabled option

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 1739ca61c1b9b7e7450a6dcff697384ed5647861
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Jan 25 10:57:54 2018 +0100

    CAMEL-12190 - Camel-AWS S3: Add a parameter to specify chunkedEncodingDisabled option
---
 .../org/apache/camel/component/aws/s3/S3Configuration.java | 14 ++++++++++++++
 .../java/org/apache/camel/component/aws/s3/S3Endpoint.java |  6 +++++-
 .../component/aws/s3/S3ComponentConfigurationTest.java     | 13 +++++++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
index c536ce0..8fd11ff 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.aws.s3;
 
 import com.amazonaws.services.s3.AmazonS3;
+import com.amazonaws.services.s3.S3ClientOptions;
 import com.amazonaws.services.s3.model.EncryptionMaterials;
 
 import org.apache.camel.RuntimeCamelException;
@@ -72,6 +73,8 @@ public class S3Configuration implements Cloneable {
     private EncryptionMaterials encryptionMaterials;
     @UriParam(label = "common", defaultValue = "false")
     private boolean useEncryption;
+    @UriParam(label = "common, advanced", defaultValue = "false")
+    private boolean chunkedEncodingDisabled;
     @UriParam(label = "producer", defaultValue = "false")
     private boolean useAwsKMS;
     @UriParam(label = "producer")
@@ -382,6 +385,17 @@ public class S3Configuration implements Cloneable {
         this.awsKMSKeyId = awsKMSKeyId;
     }
 
+    public boolean isChunkedEncodingDisabled() {
+        return chunkedEncodingDisabled;
+    }
+
+    /**
+     * Define if disabled Chunked Encoding is true or false
+     */
+    public void setChunkedEncodingDisabled(boolean chunkedEncodingDisabled) {
+        this.chunkedEncodingDisabled = chunkedEncodingDisabled;
+    }
+
     boolean hasProxyConfiguration() {
         return ObjectHelper.isNotEmpty(getProxyHost()) && ObjectHelper.isNotEmpty(getProxyPort());
     }
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Endpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Endpoint.java
index 74ef7ab..31fba55 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Endpoint.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Endpoint.java
@@ -26,6 +26,7 @@ import com.amazonaws.regions.Regions;
 import com.amazonaws.services.s3.AmazonS3;
 import com.amazonaws.services.s3.AmazonS3ClientBuilder;
 import com.amazonaws.services.s3.AmazonS3EncryptionClientBuilder;
+import com.amazonaws.services.s3.S3ClientOptions;
 import com.amazonaws.services.s3.model.CreateBucketRequest;
 import com.amazonaws.services.s3.model.ListObjectsRequest;
 import com.amazonaws.services.s3.model.ObjectMetadata;
@@ -262,12 +263,14 @@ public class S3Endpoint extends ScheduledPollEndpoint {
                     clientBuilder = clientBuilder.withRegion(Regions.valueOf(configuration.getRegion()));
                 }
                 clientBuilder = clientBuilder.withPathStyleAccessEnabled(configuration.isPathStyleAccess());
+                clientBuilder = clientBuilder.withChunkedEncodingDisabled(configuration.isChunkedEncodingDisabled());
                 client = clientBuilder.build();
             } else {
                 if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
                     encClientBuilder = encClientBuilder.withRegion(Regions.valueOf(configuration.getRegion()));
                 }
                 encClientBuilder = encClientBuilder.withPathStyleAccessEnabled(configuration.isPathStyleAccess());
+                encClientBuilder = encClientBuilder.withChunkedEncodingDisabled(configuration.isChunkedEncodingDisabled());
                 client = encClientBuilder.build();
             }
         } else {
@@ -284,16 +287,17 @@ public class S3Endpoint extends ScheduledPollEndpoint {
                     clientBuilder = clientBuilder.withRegion(Regions.valueOf(configuration.getRegion()));
                 }
                 clientBuilder = clientBuilder.withPathStyleAccessEnabled(configuration.isPathStyleAccess());
+                clientBuilder = clientBuilder.withChunkedEncodingDisabled(configuration.isChunkedEncodingDisabled());
                 client = clientBuilder.build();
             } else {
                 if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
                     encClientBuilder = encClientBuilder.withRegion(Regions.valueOf(configuration.getRegion()));
                 }
                 encClientBuilder = encClientBuilder.withPathStyleAccessEnabled(configuration.isPathStyleAccess());
+                encClientBuilder = encClientBuilder.withChunkedEncodingDisabled(configuration.isChunkedEncodingDisabled());
                 client = encClientBuilder.build();
             }
         }
-
         return client;
     }
 
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentConfigurationTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentConfigurationTest.java
index 1437cd3..17a33f9 100644
--- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentConfigurationTest.java
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentConfigurationTest.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.aws.s3;
 
 import com.amazonaws.regions.Regions;
+import com.amazonaws.services.s3.S3ClientOptions;
 
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.impl.PropertyPlaceholderDelegateRegistry;
@@ -172,6 +173,18 @@ public class S3ComponentConfigurationTest extends CamelTestSupport {
     }
     
     @Test
+    public void createEndpointWithChunkedEncoding() throws Exception {
+        
+        S3Component component = new S3Component(context);
+        S3Endpoint endpoint = (S3Endpoint) component.createEndpoint("aws-s3://MyBucket?chunkedEncodingDisabled=true&accessKey=xxx&secretKey=yyy&region=US_WEST_1");
+
+        assertEquals("MyBucket", endpoint.getConfiguration().getBucketName());
+        assertEquals("xxx", endpoint.getConfiguration().getAccessKey());
+        assertEquals("yyy", endpoint.getConfiguration().getSecretKey());
+        assertTrue(endpoint.getConfiguration().isChunkedEncodingDisabled());
+    }
+    
+    @Test
     public void createEndpointWithoutSecretKeyAndAccessKeyConfiguration() throws Exception {
         AmazonS3ClientMock mock = new AmazonS3ClientMock();
         

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

[camel] 02/02: CAMEL-12190 - Camel-AWS S3: Add a parameter to specify chunkedEncodingDisabled option - regen docs and 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 0961821f07f148c2646aa7a8e4454090231b149e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Jan 25 11:09:55 2018 +0100

    CAMEL-12190 - Camel-AWS S3: Add a parameter to specify chunkedEncodingDisabled option - regen docs and fixed CS
---
 components/camel-aws/src/main/docs/aws-s3-component.adoc     |  3 ++-
 .../component/aws/s3/S3ComponentVerifierExtensionTest.java   |  2 --
 .../component/aws/swf/SwfComponentVerifierExtensionTest.java |  1 -
 .../aws/s3/springboot/S3ComponentConfiguration.java          | 12 ++++++++++++
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/components/camel-aws/src/main/docs/aws-s3-component.adoc b/components/camel-aws/src/main/docs/aws-s3-component.adoc
index d5e42a1..157096a 100644
--- a/components/camel-aws/src/main/docs/aws-s3-component.adoc
+++ b/components/camel-aws/src/main/docs/aws-s3-component.adoc
@@ -77,7 +77,7 @@ with the following path and query parameters:
 | *bucketNameOrArn* | *Required* Bucket name or ARN |  | String
 |===
 
-==== Query Parameters (45 parameters):
+==== Query Parameters (46 parameters):
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
@@ -112,6 +112,7 @@ with the following path and query parameters:
 | *storageClass* (producer) | The storage class to set in the com.amazonaws.services.s3.model.PutObjectRequest request. |  | String
 | *useAwsKMS* (producer) | Define if KMS must be used or not | false | boolean
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). | false | boolean
+| *chunkedEncodingDisabled* ( advanced) | Define if disabled Chunked Encoding is true or false | false | boolean
 | *backoffErrorThreshold* (scheduler) | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in. |  | int
 | *backoffIdleThreshold* (scheduler) | The number of subsequent idle polls that should happen before the backoffMultipler should kick-in. |  | int
 | *backoffMultiplier* (scheduler) | To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured. |  | int
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentVerifierExtensionTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentVerifierExtensionTest.java
index ad3a638..6d5da98 100644
--- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentVerifierExtensionTest.java
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentVerifierExtensionTest.java
@@ -19,8 +19,6 @@ package org.apache.camel.component.aws.s3;
 import java.util.HashMap;
 import java.util.Map;
 
-import com.amazonaws.regions.Regions;
-
 import org.apache.camel.Component;
 import org.apache.camel.component.extension.ComponentVerifierExtension;
 import org.apache.camel.test.junit4.CamelTestSupport;
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentVerifierExtensionTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentVerifierExtensionTest.java
index 7cf38c1..7531780 100644
--- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentVerifierExtensionTest.java
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentVerifierExtensionTest.java
@@ -64,7 +64,6 @@ public class SwfComponentVerifierExtensionTest extends CamelTestSupport {
         parameters.put("type", "activity");
 
         ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.CONNECTIVITY, parameters);
-
         Assert.assertEquals(ComponentVerifierExtension.Result.Status.ERROR, result.getStatus());
     }
 
diff --git a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentConfiguration.java
index 20f336e..c19c0f6 100644
--- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentConfiguration.java
@@ -235,6 +235,10 @@ public class S3ComponentConfiguration
          * Define the id of KMS key to use in case KMS is enabled
          */
         private String awsKMSKeyId;
+        /**
+         * Define if disabled Chunked Encoding is true or false
+         */
+        private Boolean chunkedEncodingDisabled = false;
 
         public Long getPartSize() {
             return partSize;
@@ -436,5 +440,13 @@ public class S3ComponentConfiguration
         public void setAwsKMSKeyId(String awsKMSKeyId) {
             this.awsKMSKeyId = awsKMSKeyId;
         }
+
+        public Boolean getChunkedEncodingDisabled() {
+            return chunkedEncodingDisabled;
+        }
+
+        public void setChunkedEncodingDisabled(Boolean chunkedEncodingDisabled) {
+            this.chunkedEncodingDisabled = chunkedEncodingDisabled;
+        }
     }
 }
\ No newline at end of file

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