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 feea9b1f6f4e591fcb413cf3624690ec3fa23183 Author: Andrea Cosentino <[email protected]> AuthorDate: Wed Feb 7 10:14:40 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 SDB --- components/camel-aws/src/main/docs/aws-sdb-component.adoc | 5 ++--- .../apache/camel/component/aws/sdb/SdbConfiguration.java | 13 ------------- .../org/apache/camel/component/aws/sdb/SdbEndpoint.java | 7 +++---- .../component/aws/sdb/SdbComponentConfigurationTest.java | 4 ---- 4 files changed, 5 insertions(+), 24 deletions(-) diff --git a/components/camel-aws/src/main/docs/aws-sdb-component.adoc b/components/camel-aws/src/main/docs/aws-sdb-component.adoc index 8087f4f..7f41ae5 100644 --- a/components/camel-aws/src/main/docs/aws-sdb-component.adoc +++ b/components/camel-aws/src/main/docs/aws-sdb-component.adoc @@ -49,14 +49,13 @@ with the following path and query parameters: | *domainName* | *Required* The name of the domain currently worked with. | | String |=== -==== Query Parameters (11 parameters): +==== Query Parameters (10 parameters): [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type | *accessKey* (producer) | Amazon AWS Access Key | | String | *amazonSDBClient* (producer) | To use the AmazonSimpleDB as the client | | AmazonSimpleDB -| *amazonSdbEndpoint* (producer) | The region with which the AWS-SDB client wants to work with. | | String | *consistentRead* (producer) | Determines whether or not strong consistency should be enforced when data is read. | false | boolean | *maxNumberOfDomains* (producer) | The maximum number of domain names you want returned. The range is 1 to 100. | | Integer | *operation* (producer) | Operation to perform | PutAttributes | SdbOperations @@ -223,4 +222,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/sdb/SdbConfiguration.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sdb/SdbConfiguration.java index 5686f7f..d93fbe4 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sdb/SdbConfiguration.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sdb/SdbConfiguration.java @@ -35,8 +35,6 @@ public class SdbConfiguration { @UriParam private String secretKey; @UriParam - private String amazonSdbEndpoint; - @UriParam private Integer maxNumberOfDomains; @UriParam private boolean consistentRead; @@ -49,17 +47,6 @@ public class SdbConfiguration { @UriParam private String region; - /** - * The region with which the AWS-SDB client wants to work with. - */ - public void setAmazonSdbEndpoint(String amazonSdbEndpoint) { - this.amazonSdbEndpoint = amazonSdbEndpoint; - } - - public String getAmazonSdbEndpoint() { - return amazonSdbEndpoint; - } - public String getAccessKey() { return accessKey; } diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sdb/SdbEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sdb/SdbEndpoint.java index c2ace82..c671ed6 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sdb/SdbEndpoint.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sdb/SdbEndpoint.java @@ -21,7 +21,7 @@ import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.BasicAWSCredentials; -import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration; +import com.amazonaws.regions.Regions; import com.amazonaws.services.simpledb.AmazonSimpleDB; import com.amazonaws.services.simpledb.AmazonSimpleDBClientBuilder; import com.amazonaws.services.simpledb.model.CreateDomainRequest; @@ -131,9 +131,8 @@ public class SdbEndpoint extends ScheduledPollEndpoint { clientBuilder = AmazonSimpleDBClientBuilder.standard().withClientConfiguration(clientConfiguration); } } - if (ObjectHelper.isNotEmpty(configuration.getAmazonSdbEndpoint()) && ObjectHelper.isNotEmpty(configuration.getRegion())) { - EndpointConfiguration endpointConfiguration = new EndpointConfiguration(configuration.getAmazonSdbEndpoint(), configuration.getRegion()); - clientBuilder = clientBuilder.withEndpointConfiguration(endpointConfiguration); + if (ObjectHelper.isNotEmpty(configuration.getRegion())) { + clientBuilder = clientBuilder.withRegion(Regions.valueOf(configuration.getRegion())); } client = clientBuilder.build(); return client; diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sdb/SdbComponentConfigurationTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sdb/SdbComponentConfigurationTest.java index 93627e5..e2a568b 100644 --- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sdb/SdbComponentConfigurationTest.java +++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sdb/SdbComponentConfigurationTest.java @@ -39,7 +39,6 @@ public class SdbComponentConfigurationTest extends CamelTestSupport { assertEquals("yyy", endpoint.getConfiguration().getSecretKey()); assertNotNull(endpoint.getConfiguration().getAmazonSDBClient()); assertEquals(SdbOperations.PutAttributes, endpoint.getConfiguration().getOperation()); - assertNull(endpoint.getConfiguration().getAmazonSdbEndpoint()); assertFalse(endpoint.getConfiguration().isConsistentRead()); assertNull(endpoint.getConfiguration().getMaxNumberOfDomains()); } @@ -55,7 +54,6 @@ public class SdbComponentConfigurationTest extends CamelTestSupport { assertEquals("yyy", endpoint.getConfiguration().getSecretKey()); assertNull(endpoint.getConfiguration().getAmazonSDBClient()); assertEquals(SdbOperations.PutAttributes, endpoint.getConfiguration().getOperation()); - assertNull(endpoint.getConfiguration().getAmazonSdbEndpoint()); assertFalse(endpoint.getConfiguration().isConsistentRead()); assertNull(endpoint.getConfiguration().getMaxNumberOfDomains()); } @@ -76,7 +74,6 @@ public class SdbComponentConfigurationTest extends CamelTestSupport { assertNull(endpoint.getConfiguration().getSecretKey()); assertSame(mock, endpoint.getConfiguration().getAmazonSDBClient()); assertEquals(SdbOperations.PutAttributes, endpoint.getConfiguration().getOperation()); - assertNull(endpoint.getConfiguration().getAmazonSdbEndpoint()); assertFalse(endpoint.getConfiguration().isConsistentRead()); assertNull(endpoint.getConfiguration().getMaxNumberOfDomains()); } @@ -97,7 +94,6 @@ public class SdbComponentConfigurationTest extends CamelTestSupport { assertEquals("yyy", endpoint.getConfiguration().getSecretKey()); assertNotNull(endpoint.getConfiguration().getAmazonSDBClient()); assertEquals(SdbOperations.DeleteAttributes, endpoint.getConfiguration().getOperation()); - assertNull(endpoint.getConfiguration().getAmazonSdbEndpoint()); assertTrue(endpoint.getConfiguration().isConsistentRead()); assertEquals(new Integer(5), endpoint.getConfiguration().getMaxNumberOfDomains()); } -- To stop receiving notification emails like this one, please contact [email protected].
