Example usage for com.amazonaws.services.dynamodbv2.document Item withJSON

List of usage examples for com.amazonaws.services.dynamodbv2.document Item withJSON

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.document Item withJSON.

Prototype

public Item withJSON(String attrName, String json) 

Source Link

Document

Sets the value of the specified attribute in the current item to the given JSON document in the form of a string.

Usage

From source file:io.helixservice.feature.configuration.dynamo.DynamoConfigResourceLocator.java

License:Open Source License

private void createEmptyConfiguration(String environmentName) {
    try {/* ww  w  . j ava 2 s  .  co m*/
        Item item = new Item();
        item.withString("environment", environmentName);
        item.withString("service", serviceName);
        item.withJSON("config", "{}");
        configTable.putItem(item);
        LOG.info("Created default configuration in DynamoDB for environment=" + environmentName);
    } catch (Throwable t) {
        LOG.error("Unable to create default configuration in DynamoDB for environment=" + environmentName, t);
    }
}