Package com.amazonaws.services.dynamodb

Examples of com.amazonaws.services.dynamodb.AmazonDynamoDB


    @Override
    public void doStart() throws Exception {
        super.doStart();

        AmazonDynamoDB ddbClient = getDdbClient();
        String tableName = getConfiguration().getTableName();
        LOG.trace("Querying whether table [{}] already exists...", tableName);

        try {
            DescribeTableRequest request = new DescribeTableRequest().withTableName(tableName);
            TableDescription tableDescription = ddbClient.describeTable(request).getTable();
            if (!isTableActive(tableDescription)) {
                waitForTableToBecomeAvailable(tableName);
            }

            LOG.trace("Table [{}] already exists", tableName);
View Full Code Here


    }

    AmazonDynamoDB createDdbClient() {
        AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(),
                configuration.getSecretKey());
        AmazonDynamoDB client = new AmazonDynamoDBClient(credentials);
        if (configuration.getAmazonDdbEndpoint() != null) {
            client.setEndpoint(configuration.getAmazonDdbEndpoint());
        }
        configuration.setAmazonDDBClient(client);
        return client;
    }
View Full Code Here

    }

    AmazonDynamoDB createDdbClient() {
        AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(),
                configuration.getSecretKey());
        AmazonDynamoDB client = new AmazonDynamoDBClient(credentials);
        return client;
    }
View Full Code Here

    Map<String, ExpectedAttributeValue> expectedMap = new HashMap<String, ExpectedAttributeValue>();
    expectedMap.put("id", new ExpectedAttributeValue(false));

    Map<String, AttributeValue> item = createGenericItem(value, null);

    AmazonDynamoDB client = getClient();
    client.putItem(new PutItemRequest(tableName, item).withExpected(expectedMap));

    try {
      client.putItem(new PutItemRequest(tableName, item).withExpected(expectedMap));
      Assert.assertTrue(false);// Should have thrown a ConditionalCheckFailedException
    } catch (ConditionalCheckFailedException ccfe) {
    }
  }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodb.AmazonDynamoDB

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.