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/02/07 09:45:02 UTC

[camel] 05/10: CAMEL-12234 - Camel-AWS: Since we are using builders, we need to remove the AWS endpoint options on the components that are using them - AWS S3

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 f34bf7cf6c5f4009efd3abf1918e9b76d7a31ae2
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Feb 7 10:10:33 2018 +0100

    CAMEL-12234 - Camel-AWS: Since we are using builders, we need to remove the AWS endpoint options on the components that are using them - AWS S3
---
 components/camel-aws/src/main/docs/aws-s3-component.adoc    |  5 ++---
 .../org/apache/camel/component/aws/s3/S3Configuration.java  | 13 -------------
 .../java/org/apache/camel/component/aws/s3/S3Endpoint.java  |  4 ----
 .../component/aws/s3/S3ComponentConfigurationTest.java      |  6 +-----
 .../aws/s3/springboot/S3ComponentConfiguration.java         | 12 ------------
 5 files changed, 3 insertions(+), 37 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 bbd3f73..2d80eec 100644
--- a/components/camel-aws/src/main/docs/aws-s3-component.adoc
+++ b/components/camel-aws/src/main/docs/aws-s3-component.adoc
@@ -78,13 +78,12 @@ with the following path and query parameters:
 | *bucketNameOrArn* | *Required* Bucket name or ARN |  | String
 |===
 
-==== Query Parameters (50 parameters):
+==== Query Parameters (49 parameters):
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
 | *amazonS3Client* (common) | Reference to a com.amazonaws.services.sqs.AmazonS3 in the link:registry.htmlRegistry. |  | AmazonS3
-| *amazonS3Endpoint* (common) | The region with which the AWS-S3 client wants to work with. |  | String
 | *pathStyleAccess* (common) | Whether or not the S3 client should use path style access | false | boolean
 | *policy* (common) | The policy for this queue to set in the com.amazonaws.services.s3.AmazonS3setBucketPolicy() method. |  | String
 | *proxyHost* (common) | To define a proxy host when instantiating the SQS client |  | String
@@ -334,4 +333,4 @@ where `${camel-version`} must be replaced by the actual version of Camel
 * link:endpoint.html[Endpoint]
 * link:getting-started.html[Getting Started]
 
-* link:aws.html[AWS Component]
\ No newline at end of file
+* link:aws.html[AWS Component]
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 f580633..ad13880 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
@@ -49,8 +49,6 @@ public class S3Configuration implements Cloneable {
     @UriParam(label = "producer", defaultValue = "" + 25 * 1024 * 1024)
     private long partSize = 25 * 1024 * 1024;
     @UriParam
-    private String amazonS3Endpoint;
-    @UriParam
     private String policy;
     @UriParam(label = "producer")
     private String storageClass;
@@ -111,17 +109,6 @@ public class S3Configuration implements Cloneable {
         this.multiPartUpload = multiPartUpload;
     }
 
-    /**
-     * The region with which the AWS-S3 client wants to work with.
-     */
-    public void setAmazonS3Endpoint(String amazonS3Endpoint) {
-        this.amazonS3Endpoint = amazonS3Endpoint;
-    }
-
-    public String getAmazonS3Endpoint() {
-        return amazonS3Endpoint;
-    }
-
     public String getAccessKey() {
         return accessKey;
     }
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 1d930e0..ede278c 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
@@ -104,10 +104,6 @@ public class S3Endpoint extends ScheduledPollEndpoint {
 
         s3Client = configuration.getAmazonS3Client() != null ? configuration.getAmazonS3Client() : createS3Client();
 
-        if (ObjectHelper.isNotEmpty(configuration.getAmazonS3Endpoint())) {
-            s3Client.setEndpoint(configuration.getAmazonS3Endpoint());
-        }
-
         String fileName = getConfiguration().getFileName();
 
         if (fileName != null) {
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 2e1faf0..8144d7f 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
@@ -41,7 +41,6 @@ public class S3ComponentConfigurationTest extends CamelTestSupport {
         assertNull(endpoint.getConfiguration().getRegion());
         assertTrue(endpoint.getConfiguration().isDeleteAfterRead());
         assertEquals(10, endpoint.getMaxMessagesPerPoll());
-        assertNull(endpoint.getConfiguration().getAmazonS3Endpoint());
         assertNull(endpoint.getConfiguration().getPolicy());
         assertNull(endpoint.getConfiguration().getPrefix());
         assertTrue(endpoint.getConfiguration().isIncludeBody());
@@ -59,7 +58,6 @@ public class S3ComponentConfigurationTest extends CamelTestSupport {
         assertNull(endpoint.getConfiguration().getRegion());
         assertTrue(endpoint.getConfiguration().isDeleteAfterRead());
         assertEquals(10, endpoint.getMaxMessagesPerPoll());
-        assertNull(endpoint.getConfiguration().getAmazonS3Endpoint());
         assertNull(endpoint.getConfiguration().getPolicy());
         assertNull(endpoint.getConfiguration().getPrefix());
         assertTrue(endpoint.getConfiguration().isIncludeBody());
@@ -93,7 +91,6 @@ public class S3ComponentConfigurationTest extends CamelTestSupport {
         assertNull(endpoint.getConfiguration().getRegion());
         assertTrue(endpoint.getConfiguration().isDeleteAfterRead());
         assertEquals(10, endpoint.getMaxMessagesPerPoll());
-        assertNull(endpoint.getConfiguration().getAmazonS3Endpoint());
         assertNull(endpoint.getConfiguration().getPolicy());
         assertNull(endpoint.getConfiguration().getPrefix());
         assertTrue(endpoint.getConfiguration().isIncludeBody());
@@ -106,7 +103,7 @@ public class S3ComponentConfigurationTest extends CamelTestSupport {
         ((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry()).bind("amazonS3Client", mock);
     
         S3Component component = new S3Component(context);
-        S3Endpoint endpoint = (S3Endpoint) component.createEndpoint("aws-s3://MyBucket?amazonS3Client=#amazonS3Client&amazonS3Endpoint=sns.eu-west-1.amazonaws.com"
+        S3Endpoint endpoint = (S3Endpoint) component.createEndpoint("aws-s3://MyBucket?amazonS3Client=#amazonS3Client"
                 + "&accessKey=xxx&secretKey=yyy&region=us-west-1&deleteAfterRead=false&maxMessagesPerPoll=1&policy=%7B%22Version%22%3A%222008-10-17%22,%22Id%22%3A%22Policy4324355464%22,"
                 + "%22Statement%22%3A%5B%7B%22Sid%22%3A%22Stmt456464646477%22,%22Action%22%3A%5B%22s3%3AGetObject%22%5D,%22Effect%22%3A%22Allow%22,"
                 + "%22Resource%22%3A%5B%22arn%3Aaws%3As3%3A%3A%3Amybucket/some/path/*%22%5D,%22Principal%22%3A%7B%22AWS%22%3A%5B%22*%22%5D%7D%7D%5D%7D&storageClass=REDUCED_REDUNDANCY"
@@ -119,7 +116,6 @@ public class S3ComponentConfigurationTest extends CamelTestSupport {
         assertEquals("us-west-1", endpoint.getConfiguration().getRegion());
         assertFalse(endpoint.getConfiguration().isDeleteAfterRead());
         assertEquals(1, endpoint.getMaxMessagesPerPoll());
-        assertEquals("sns.eu-west-1.amazonaws.com", endpoint.getConfiguration().getAmazonS3Endpoint());
         assertEquals("{\"Version\":\"2008-10-17\",\"Id\":\"Policy4324355464\",\"Statement\":[{\"Sid\":\"Stmt456464646477\",\"Action\":[\"s3:GetObject\"],\"Effect\":\"Allow\",\"Resource\":"
                 + "[\"arn:aws:s3:::mybucket/some/path/*\"],\"Principal\":{\"AWS\":[\"*\"]}}]}", endpoint.getConfiguration().getPolicy());
         assertEquals("REDUCED_REDUNDANCY", endpoint.getConfiguration().getStorageClass());
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 8442ce3..d33167f 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
@@ -115,10 +115,6 @@ public class S3ComponentConfiguration
          */
         private Boolean multiPartUpload = false;
         /**
-         * The region with which the AWS-S3 client wants to work with.
-         */
-        private String amazonS3Endpoint;
-        /**
          * Amazon AWS Access Key
          */
         private String accessKey;
@@ -272,14 +268,6 @@ public class S3ComponentConfiguration
             this.multiPartUpload = multiPartUpload;
         }
 
-        public String getAmazonS3Endpoint() {
-            return amazonS3Endpoint;
-        }
-
-        public void setAmazonS3Endpoint(String amazonS3Endpoint) {
-            this.amazonS3Endpoint = amazonS3Endpoint;
-        }
-
         public String getAccessKey() {
             return accessKey;
         }

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