Example usage for com.amazonaws.services.simpleemail AmazonSimpleEmailServiceAsyncClientBuilder standard

List of usage examples for com.amazonaws.services.simpleemail AmazonSimpleEmailServiceAsyncClientBuilder standard

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleemail AmazonSimpleEmailServiceAsyncClientBuilder standard.

Prototype

public static AmazonSimpleEmailServiceAsyncClientBuilder standard() 

Source Link

Usage

From source file:org.duracloud.notification.AmazonNotificationFactory.java

License:Apache License

@Override
public void initialize(String accessKey, String secretKey) {
    if (StringUtils.isNotBlank(accessKey)) {
        log.debug("initialize email service with provided credentials");
        emailService = AmazonSimpleEmailServiceAsyncClientBuilder.standard()
                .withCredentials(/*  w  w  w.ja v a 2 s.c o  m*/
                        new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)))
                .build();
    } else {
        log.debug("initialize email service using the default AWS Default Credentials Chain provider");
        emailService = AmazonSimpleEmailServiceAsyncClientBuilder.defaultClient();
    }
}