Java Code Examples for com.amazonaws.services.cloudwatch.AmazonCloudWatchClientBuilder#build()

The following examples show how to use com.amazonaws.services.cloudwatch.AmazonCloudWatchClientBuilder#build() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CloudwatchReporterFactory.java    From bender with Apache License 2.0 5 votes vote down vote up
@Override
public void setConf(AbstractConfig config) {
  this.config = (CloudwatchReporterConfig) config;
  AmazonCloudWatchClientBuilder clientBuilder = AmazonCloudWatchClientBuilder.standard();

  if (this.config.getRegion() != null) {
    clientBuilder.withRegion(this.config.getRegion());
  }

  this.client = clientBuilder.build();
}
 
Example 2
Source File: BasicKinesisProvider.java    From beam with Apache License 2.0 5 votes vote down vote up
@Override
public AmazonCloudWatch getCloudWatchClient() {
  AmazonCloudWatchClientBuilder clientBuilder =
      AmazonCloudWatchClientBuilder.standard().withCredentials(getCredentialsProvider());
  if (serviceEndpoint == null) {
    clientBuilder.withRegion(region);
  } else {
    clientBuilder.withEndpointConfiguration(
        new AwsClientBuilder.EndpointConfiguration(serviceEndpoint, region.getName()));
  }
  return clientBuilder.build();
}
 
Example 3
Source File: BasicSnsProvider.java    From beam with Apache License 2.0 5 votes vote down vote up
@Override
public AmazonCloudWatch getCloudWatchClient() {
  AmazonCloudWatchClientBuilder clientBuilder =
      AmazonCloudWatchClientBuilder.standard().withCredentials(getCredentialsProvider());
  if (serviceEndpoint == null) {
    clientBuilder.withRegion(region);
  } else {
    clientBuilder.withEndpointConfiguration(
        new AwsClientBuilder.EndpointConfiguration(serviceEndpoint, region.getName()));
  }
  return clientBuilder.build();
}
 
Example 4
Source File: BasicDynamoDBProvider.java    From beam with Apache License 2.0 5 votes vote down vote up
@Override
public AmazonCloudWatch getCloudWatchClient() {
  AmazonCloudWatchClientBuilder clientBuilder =
      AmazonCloudWatchClientBuilder.standard().withCredentials(getCredentialsProvider());
  if (serviceEndpoint == null) {
    clientBuilder.withRegion(region);
  } else {
    clientBuilder.withEndpointConfiguration(
        new AwsClientBuilder.EndpointConfiguration(serviceEndpoint, region.getName()));
  }
  return clientBuilder.build();
}
 
Example 5
Source File: DynamoDBSourceConfig.java    From pulsar with Apache License 2.0 5 votes vote down vote up
public AmazonCloudWatch buildCloudwatchClient(AwsCredentialProviderPlugin credPlugin) {
    AmazonCloudWatchClientBuilder builder = AmazonCloudWatchClientBuilder.standard();

    if (!this.getAwsEndpoint().isEmpty()) {
        builder.setEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(this.getCloudwatchEndpoint(), this.getAwsRegion()));
    }
    if (!this.getAwsRegion().isEmpty()) {
        builder.setRegion(this.getAwsRegion());
    }
    builder.setCredentials(credPlugin.getCredentialProvider());
    return builder.build();
}
 
Example 6
Source File: TalendKinesisProvider.java    From components with Apache License 2.0 5 votes vote down vote up
@Override
public AmazonCloudWatch getCloudWatchClient() {
    AmazonCloudWatchClientBuilder clientBuilder =
            AmazonCloudWatchClientBuilder.standard().withCredentials(getCredentialsProvier());
    if (specifyEndpoint) {
        clientBuilder
                .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, region.getName()));
    } else {
        clientBuilder.setRegion(region.getName());
    }
    return clientBuilder.build();
}