Search in sources :

Example 1 with AmazonSimpleEmailService

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;
}
Also used : AmazonSimpleEmailService(com.amazonaws.services.simpleemail.AmazonSimpleEmailService) AmazonSimpleEmailServiceClient(com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) AWSCredentials(com.amazonaws.auth.AWSCredentials) ClientConfiguration(com.amazonaws.ClientConfiguration) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials)

Aggregations

ClientConfiguration (com.amazonaws.ClientConfiguration)1 AWSCredentials (com.amazonaws.auth.AWSCredentials)1 BasicAWSCredentials (com.amazonaws.auth.BasicAWSCredentials)1 AmazonSimpleEmailService (com.amazonaws.services.simpleemail.AmazonSimpleEmailService)1 AmazonSimpleEmailServiceClient (com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient)1