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 376da27d065988f8f4ef4803a221d31f1439012b Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Wed Feb 7 09:49:51 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 EC2 --- components/camel-aws/src/main/docs/aws-ec2-component.adoc | 5 ++--- .../java/org/apache/camel/component/aws/cw/CwEndpoint.java | 1 - .../org/apache/camel/component/aws/ddb/DdbEndpoint.java | 2 -- .../apache/camel/component/aws/ec2/EC2Configuration.java | 13 ------------- .../org/apache/camel/component/aws/ec2/EC2Endpoint.java | 10 +++------- .../aws/ec2/springboot/EC2ComponentConfiguration.java | 12 ------------ 6 files changed, 5 insertions(+), 38 deletions(-) diff --git a/components/camel-aws/src/main/docs/aws-ec2-component.adoc b/components/camel-aws/src/main/docs/aws-ec2-component.adoc index 12c3b54..32f2d6a 100644 --- a/components/camel-aws/src/main/docs/aws-ec2-component.adoc +++ b/components/camel-aws/src/main/docs/aws-ec2-component.adoc @@ -61,14 +61,13 @@ with the following path and query parameters: | *label* | *Required* Logical name | | String |=== -==== Query Parameters (9 parameters): +==== Query Parameters (8 parameters): [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type | *accessKey* (producer) | Amazon AWS Access Key | | String | *amazonEc2Client* (producer) | To use a existing configured AmazonEC2Client as client | | AmazonEC2Client -| *amazonEc2Endpoint* (producer) | The region with which the AWS-EC2 client wants to work with. | | String | *operation* (producer) | *Required* The operation to perform. It can be createAndRunInstances startInstances stopInstances terminateInstances describeInstances describeInstancesStatus rebootInstances monitorInstances unmonitorInstances createTags or deleteTags | | EC2Operations | *proxyHost* (producer) | To define a proxy host when instantiating the EC2 client | | String | *proxyPort* (producer) | To define a proxy port when instantiating the EC2 client | | Integer @@ -141,4 +140,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/cw/CwEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/cw/CwEndpoint.java index d947182..735131f 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/cw/CwEndpoint.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/cw/CwEndpoint.java @@ -21,7 +21,6 @@ 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.cloudwatch.AmazonCloudWatch; import com.amazonaws.services.cloudwatch.AmazonCloudWatchClientBuilder; diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/DdbEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/DdbEndpoint.java index f3a65fb..b10cecd 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/DdbEndpoint.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/DdbEndpoint.java @@ -22,10 +22,8 @@ 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.dynamodbv2.AmazonDynamoDB; -import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient; import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder; import com.amazonaws.services.dynamodbv2.model.CreateTableRequest; import com.amazonaws.services.dynamodbv2.model.DescribeTableRequest; diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java index ad8bd03..0576cb7 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Configuration.java @@ -36,8 +36,6 @@ public class EC2Configuration implements Cloneable { @UriParam(label = "producer", secret = true) private String secretKey; @UriParam(label = "producer") - private String amazonEc2Endpoint; - @UriParam(label = "producer") @Metadata(required = "true") private EC2Operations operation; @UriParam(label = "producer") @@ -79,17 +77,6 @@ public class EC2Configuration implements Cloneable { public void setSecretKey(String secretKey) { this.secretKey = secretKey; } - - public String getAmazonEc2Endpoint() { - return amazonEc2Endpoint; - } - - /** - * The region with which the AWS-EC2 client wants to work with. - */ - public void setAmazonEc2Endpoint(String amazonEc2Endpoint) { - this.amazonEc2Endpoint = amazonEc2Endpoint; - } public EC2Operations getOperation() { return operation; diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Endpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Endpoint.java index a9a6cc5..bd00ee9 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Endpoint.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Endpoint.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.ec2.AmazonEC2; import com.amazonaws.services.ec2.AmazonEC2Client; import com.amazonaws.services.ec2.AmazonEC2ClientBuilder; @@ -68,9 +68,6 @@ public class EC2Endpoint extends ScheduledPollEndpoint { super.doStart(); ec2Client = configuration.getAmazonEc2Client() != null ? configuration.getAmazonEc2Client() : (AmazonEC2Client) createEc2Client(); - if (ObjectHelper.isNotEmpty(configuration.getAmazonEc2Endpoint())) { - ec2Client.setEndpoint(configuration.getAmazonEc2Endpoint()); - } } public EC2Configuration getConfiguration() { @@ -107,9 +104,8 @@ public class EC2Endpoint extends ScheduledPollEndpoint { clientBuilder = AmazonEC2ClientBuilder.standard().withClientConfiguration(clientConfiguration); } } - if (ObjectHelper.isNotEmpty(configuration.getAmazonEc2Endpoint()) && ObjectHelper.isNotEmpty(configuration.getRegion())) { - EndpointConfiguration endpointConfiguration = new EndpointConfiguration(configuration.getAmazonEc2Endpoint(), 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/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/ec2/springboot/EC2ComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/ec2/springboot/EC2ComponentConfiguration.java index c4896dd..5ef474a 100644 --- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/ec2/springboot/EC2ComponentConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/ec2/springboot/EC2ComponentConfiguration.java @@ -115,10 +115,6 @@ public class EC2ComponentConfiguration */ private String secretKey; /** - * The region with which the AWS-EC2 client wants to work with. - */ - private String amazonEc2Endpoint; - /** * The operation to perform. It can be createAndRunInstances, * startInstances, stopInstances, terminateInstances, describeInstances, * describeInstancesStatus, rebootInstances, monitorInstances, @@ -153,14 +149,6 @@ public class EC2ComponentConfiguration this.secretKey = secretKey; } - public String getAmazonEc2Endpoint() { - return amazonEc2Endpoint; - } - - public void setAmazonEc2Endpoint(String amazonEc2Endpoint) { - this.amazonEc2Endpoint = amazonEc2Endpoint; - } - public EC2Operations getOperation() { return operation; } -- To stop receiving notification emails like this one, please contact acosent...@apache.org.