Example usage for com.amazonaws.services.cloudwatch AmazonCloudWatchAsyncClient AmazonCloudWatchAsyncClient

List of usage examples for com.amazonaws.services.cloudwatch AmazonCloudWatchAsyncClient AmazonCloudWatchAsyncClient

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudwatch AmazonCloudWatchAsyncClient AmazonCloudWatchAsyncClient.

Prototype

@Deprecated
public AmazonCloudWatchAsyncClient(AWSCredentialsProvider awsCredentialsProvider,
        ExecutorService executorService) 

Source Link

Document

Constructs a new asynchronous client to invoke service methods on CloudWatch using the specified AWS account credentials provider and executor service.

Usage

From source file:com.vmware.photon.controller.model.adapters.awsadapter.AWSUtils.java

License:Open Source License

public static AmazonCloudWatchAsyncClient getStatsAsyncClient(AuthCredentialsServiceState credentials,
        String region, ExecutorService executorService, boolean isMockRequest) {
    AmazonCloudWatchAsyncClient client = new AmazonCloudWatchAsyncClient(
            new BasicAWSCredentials(credentials.privateKeyId, credentials.privateKey), executorService);

    client.setRegion(Region.getRegion(Regions.fromName(region)));
    // make a call to validate credentials
    if (!isMockRequest) {
        client.describeAlarms();/*  w w  w . j  a  v  a2 s . co m*/
    }
    return client;
}