Example usage for com.amazonaws.services.dynamodbv2 AmazonDynamoDBAsyncClientBuilder standard

List of usage examples for com.amazonaws.services.dynamodbv2 AmazonDynamoDBAsyncClientBuilder standard

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2 AmazonDynamoDBAsyncClientBuilder standard.

Prototype

public static AmazonDynamoDBAsyncClientBuilder standard() 

Source Link

Usage

From source file:org.springframework.cloud.stream.binder.kinesis.config.KinesisBinderConfiguration.java

License:Apache License

@Bean
@ConditionalOnMissingBean//from  ww  w  .j a  v a 2 s .  c om
public AmazonDynamoDBAsync dynamoDB(AWSCredentialsProvider awsCredentialsProvider,
        RegionProvider regionProvider) {

    return AmazonDynamoDBAsyncClientBuilder.standard().withCredentials(awsCredentialsProvider)
            .withRegion(regionProvider.getRegion().getName()).build();
}

From source file:org.springframework.cloud.stream.binder.kinesis.LocalDynamoDbResource.java

License:Apache License

@Override
protected void obtainResource() {
    String url = "http://localhost:" + this.port;

    this.resource = AmazonDynamoDBAsyncClientBuilder.standard()
            .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials("", "")))
            .withClientConfiguration(new ClientConfiguration().withMaxErrorRetry(0).withConnectionTimeout(1000))
            .withEndpointConfiguration(/*from  ww w  . ja  v a 2 s  .  c  om*/
                    new AwsClientBuilder.EndpointConfiguration(url, Regions.DEFAULT_REGION.getName()))
            .build();

    this.resource.listTables();
}

From source file:org.springframework.integration.aws.DynamoDbRunning.java

License:Apache License

@Override
public Statement apply(Statement base, Description description) {
    assumeTrue(dynamoDbOnline.get(this.port));

    String url = "http://localhost:" + this.port;

    this.amazonDynamoDB = AmazonDynamoDBAsyncClientBuilder.standard()
            .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials("", "")))
            .withClientConfiguration(new ClientConfiguration().withMaxErrorRetry(0).withConnectionTimeout(1000))
            .withEndpointConfiguration(//from  w  w  w. j a v a  2  s  . c om
                    new AwsClientBuilder.EndpointConfiguration(url, Regions.DEFAULT_REGION.getName()))
            .build();

    try {
        this.amazonDynamoDB.listTables();
    } catch (SdkClientException e) {
        logger.warn("Tests not running because no DynamoDb on " + url, e);
        assumeNoException(e);
    }
    return super.apply(base, description);
}