Search in sources :

Example 1 with AmazonKinesisAsyncClientBuilder

use of com.amazonaws.services.kinesis.AmazonKinesisAsyncClientBuilder in project hazelcast by hazelcast.

the class AwsConfig method buildClient.

public AmazonKinesisAsync buildClient() {
    AmazonKinesisAsyncClientBuilder builder = AmazonKinesisAsyncClientBuilder.standard();
    if (endpoint == null) {
        if (region != null) {
            builder.setRegion(region);
        }
    } else {
        builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, region));
    }
    builder.withCredentials(accessKey == null ? new DefaultAWSCredentialsProviderChain() : new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)));
    builder.withClientConfiguration(new ClientConfiguration());
    return builder.build();
}
Also used : DefaultAWSCredentialsProviderChain(com.amazonaws.auth.DefaultAWSCredentialsProviderChain) AWSStaticCredentialsProvider(com.amazonaws.auth.AWSStaticCredentialsProvider) AmazonKinesisAsyncClientBuilder(com.amazonaws.services.kinesis.AmazonKinesisAsyncClientBuilder) AwsClientBuilder(com.amazonaws.client.builder.AwsClientBuilder) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) ClientConfiguration(com.amazonaws.ClientConfiguration)

Aggregations

ClientConfiguration (com.amazonaws.ClientConfiguration)1 AWSStaticCredentialsProvider (com.amazonaws.auth.AWSStaticCredentialsProvider)1 BasicAWSCredentials (com.amazonaws.auth.BasicAWSCredentials)1 DefaultAWSCredentialsProviderChain (com.amazonaws.auth.DefaultAWSCredentialsProviderChain)1 AwsClientBuilder (com.amazonaws.client.builder.AwsClientBuilder)1 AmazonKinesisAsyncClientBuilder (com.amazonaws.services.kinesis.AmazonKinesisAsyncClientBuilder)1