use of com.amazonaws.services.simpleemail.AmazonSimpleEmailService in project camel by apache.
the class SesEndpoint method createSESClient.
private AmazonSimpleEmailService createSESClient() {
AmazonSimpleEmailService client = null;
ClientConfiguration clientConfiguration = null;
boolean isClientConfigFound = false;
if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost(configuration.getProxyHost());
clientConfiguration.setProxyPort(configuration.getProxyPort());
isClientConfigFound = true;
}
if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
if (isClientConfigFound) {
client = new AmazonSimpleEmailServiceClient(credentials, clientConfiguration);
} else {
client = new AmazonSimpleEmailServiceClient(credentials);
}
} else {
if (isClientConfigFound) {
client = new AmazonSimpleEmailServiceClient();
} else {
client = new AmazonSimpleEmailServiceClient(clientConfiguration);
}
}
return client;
}
Aggregations