Example usage for com.amazonaws.services.dynamodbv2 AmazonDynamoDBClient setRegion

List of usage examples for com.amazonaws.services.dynamodbv2 AmazonDynamoDBClient setRegion

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2 AmazonDynamoDBClient setRegion.

Prototype

@Deprecated
public void setRegion(Region region) throws IllegalArgumentException 

Source Link

Document

An alternative to AmazonWebServiceClient#setEndpoint(String) , sets the regional endpoint for this client's service calls.

Usage

From source file:io.ignitr.dispatchr.manager.Application.java

License:Apache License

@Autowired
@Bean//ww w  .j av  a  2 s. c  om
public AmazonDynamoDBClient amazonDynamoDBClient(DeploymentContext deploymentContext) {
    AmazonDynamoDBClient client = new AmazonDynamoDBClient(new DefaultAWSCredentialsProviderChain());
    client.setRegion(Region.getRegion(Regions.fromName(deploymentContext.getRegion())));

    return client;
}

From source file:org.kmbmicro.chatwebsocket.DbString.java

public static void init() {
    try {/*from   w  ww . j  ava2  s .c  o  m*/
        credentials = new ProfileCredentialsProvider("default").getCredentials();
    } catch (Exception e) {
        throw new AmazonClientException("Cannot load the credentials from the credential profiles file. "
                + "Please make sure that your credentials file is at the correct "
                + "location (/Users/sandiwibowo/.aws/credentials), and is in valid format.", e);
    }
    AmazonDynamoDBClient dynamoDBAWS = new AmazonDynamoDBClient(credentials);
    Region usWest2 = Region.getRegion(Regions.US_WEST_2);
    dynamoDBAWS.setRegion(usWest2);
    dynamoDB = new DynamoDB(dynamoDBAWS);
}