You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cm...@apache.org on 2011/12/19 18:20:57 UTC
svn commit: r1220858 - in
/camel/branches/camel-2.8.x/components/camel-aws/src:
main/java/org/apache/camel/component/aws/ses/
test/java/org/apache/camel/component/aws/ses/
Author: cmueller
Date: Mon Dec 19 17:20:57 2011
New Revision: 1220858
URL: http://svn.apache.org/viewvc?rev=1220858&view=rev
Log:
CAMEL-3591: Add Simple Email Service SES to camel-aws
Modified:
camel/branches/camel-2.8.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesConfiguration.java
camel/branches/camel-2.8.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesEndpoint.java
camel/branches/camel-2.8.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/ses/SesComponentConfigurationTest.java
Modified: camel/branches/camel-2.8.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesConfiguration.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesConfiguration.java?rev=1220858&r1=1220857&r2=1220858&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesConfiguration.java (original)
+++ camel/branches/camel-2.8.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesConfiguration.java Mon Dec 19 17:20:57 2011
@@ -30,6 +30,7 @@ public class SesConfiguration {
private AmazonSimpleEmailService amazonSESClient;
private String accessKey;
private String secretKey;
+ private String amazonSESEndpoint;
private String subject;
private String from;
private List<String> to;
@@ -107,6 +108,14 @@ public class SesConfiguration {
public void setReplyToAddresses(String replyToAddresses) {
this.replyToAddresses = Arrays.asList(replyToAddresses.split(","));
}
+
+ public String getAmazonSESEndpoint() {
+ return amazonSESEndpoint;
+ }
+
+ public void setAmazonSESEndpoint(String amazonSesEndpoint) {
+ this.amazonSESEndpoint = amazonSesEndpoint;
+ }
@Override
public String toString() {
@@ -114,6 +123,7 @@ public class SesConfiguration {
+ "accessKey='" + accessKey + '\''
+ ", amazonSESClient=" + amazonSESClient
+ ", secretKey=xxxxxxxxxxxxxxx"
+ + ", amazonSesEndpoint='" + amazonSESEndpoint + '\''
+ ", subject='" + subject + '\''
+ ", from='" + from + '\''
+ ", to='" + to + '\''
Modified: camel/branches/camel-2.8.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesEndpoint.java?rev=1220858&r1=1220857&r2=1220858&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesEndpoint.java (original)
+++ camel/branches/camel-2.8.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesEndpoint.java Mon Dec 19 17:20:57 2011
@@ -64,6 +64,9 @@ public class SesEndpoint extends Default
private AmazonSimpleEmailService createSESClient() {
AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
AmazonSimpleEmailService client = new AmazonSimpleEmailServiceClient(credentials);
+ if (configuration.getAmazonSESEndpoint() != null) {
+ client.setEndpoint(configuration.getAmazonSESEndpoint());
+ }
configuration.setAmazonSESClient(client);
return client;
}
Modified: camel/branches/camel-2.8.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/ses/SesComponentConfigurationTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/ses/SesComponentConfigurationTest.java?rev=1220858&r1=1220857&r2=1220858&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/ses/SesComponentConfigurationTest.java (original)
+++ camel/branches/camel-2.8.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/ses/SesComponentConfigurationTest.java Mon Dec 19 17:20:57 2011
@@ -31,6 +31,7 @@ public class SesComponentConfigurationTe
assertEquals("from@example.com", endpoint.getConfiguration().getFrom());
assertEquals("xxx", endpoint.getConfiguration().getAccessKey());
assertEquals("yyy", endpoint.getConfiguration().getSecretKey());
+ assertNull(endpoint.getConfiguration().getAmazonSESEndpoint());
assertNull(endpoint.getConfiguration().getAmazonSESClient());
assertNull(endpoint.getConfiguration().getTo());
assertNull(endpoint.getConfiguration().getSubject());
@@ -52,6 +53,7 @@ public class SesComponentConfigurationTe
assertEquals("from@example.com", endpoint.getConfiguration().getFrom());
assertNull(endpoint.getConfiguration().getAccessKey());
assertNull(endpoint.getConfiguration().getSecretKey());
+ assertNull(endpoint.getConfiguration().getAmazonSESEndpoint());
assertSame(mock, endpoint.getConfiguration().getAmazonSESClient());
assertNull(endpoint.getConfiguration().getTo());
assertNull(endpoint.getConfiguration().getSubject());
@@ -63,12 +65,13 @@ public class SesComponentConfigurationTe
public void createEndpointWithMaximalConfiguration() throws Exception {
SesComponent component = new SesComponent(context);
SesEndpoint endpoint = (SesEndpoint) component.createEndpoint("aws-ses://from@example.com?accessKey=xxx"
- + "&secretKey=yyy&to=to1@example.com,to2@example.com&subject=Subject&returnPath=bounce@example.com"
- + "&replyToAddresses=replyTo1@example.com,replyTo2@example.com");
+ + "&secretKey=yyy&to=to1@example.com,to2@example.com&amazonSESEndpoint=us-east-1&subject=Subject"
+ + "&returnPath=bounce@example.com&replyToAddresses=replyTo1@example.com,replyTo2@example.com");
assertEquals("from@example.com", endpoint.getConfiguration().getFrom());
assertEquals("xxx", endpoint.getConfiguration().getAccessKey());
assertEquals("yyy", endpoint.getConfiguration().getSecretKey());
+ assertEquals("us-east-1", endpoint.getConfiguration().getAmazonSESEndpoint());
assertNull(endpoint.getConfiguration().getAmazonSESClient());
assertEquals(2, endpoint.getConfiguration().getTo().size());
assertTrue(endpoint.getConfiguration().getTo().contains("to1@example.com"));