Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   *
   *  http://aws.amazon.com/apache2.0
   *
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.dynamodbv2.document;
 
 import java.util.List;
 import java.util.Map;
 
 
DynamoDB Document API. This class is the entry point to make use of this library.
 
 public class DynamoDB implements ListTablesApiBatchGetItemApi,
         BatchWriteItemApi {
     private final AmazonDynamoDB client;
 
     private final ListTablesImpl listTablesDelegate;
     private final BatchGetItemImpl batchGetItemDelegate;
     private final BatchWriteItemImpl batchWriteItemDelegate;
 
     public DynamoDB(AmazonDynamoDB client) {
         if (client == null) {
             throw new IllegalArgumentException();
         }
         this. = client;
         this. = new ListTablesImpl(client);
         this. = new BatchGetItemImpl(client);
         this. = new BatchWriteItemImpl(client);
     }

    
Create a DynamoDB object that talks to the specified AWS region. The underlying service client will use all the default client configurations, including the default credentials provider chain. See com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.() for more information.

If you need more control over the client configuration, use DynamoDB(com.amazonaws.services.dynamodbv2.AmazonDynamoDB) instead.

Parameters:
regionEnum the AWS region enum
See also:
AmazonDynamoDBClient.com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.()
 
     public DynamoDB(Regions regionEnum) {
         this(new AmazonDynamoDBClient()
                 .<AmazonDynamoDBClient>withRegion(regionEnum));
     }

    
Returns the specified DynamoDB table. No network call is involved.
 
     public Table getTable(String tableName) {
         return new Table(tableName);
     }

    
Creates the specified table in DynamoDB.
 
     public Table createTable(CreateTableRequest req) {
         CreateTableResult result = .createTable(req);
         return new Table(req.getTableName(),
             result.getTableDescription());
     }

    
Creates the specified table in DynamoDB.
    public Table createTable(String tableName,
            List<KeySchemaElementkeySchema,
            List<AttributeDefinitionattributeDefinitions,
            ProvisionedThroughput provisionedThroughput) {
        return createTable(new CreateTableRequest()
            .withTableName(tableName)
            .withKeySchema(keySchema)
            .withAttributeDefinitions(attributeDefinitions)
            .withProvisionedThroughput(provisionedThroughput));
    }
    @Override
        return .listTables();
    }
    @Override
    public TableCollection<ListTablesResultlistTables(String exclusiveStartTableName) {
        return .listTables(exclusiveStartTableName);
    }
    @Override
    public TableCollection<ListTablesResultlistTables(String exclusiveStartTableName,
            int maxResultSize) {
        return .listTables(exclusiveStartTableName,
                maxResultSize);
    }
    @Override
    public TableCollection<ListTablesResultlistTables(int maxResultSize) {
        return .listTables(maxResultSize);
    }
    @Override
        return .listTables(spec);
    }
    @Override
            ReturnConsumedCapacity returnConsumedCapacity,
            TableKeysAndAttributes ... tableKeysAndAttributes) {
        return .batchGetItem(returnConsumedCapacity,
                tableKeysAndAttributes);
    }
    @Override
            TableKeysAndAttributes ... tableKeysAndAttributes) {
        return .batchGetItem(tableKeysAndAttributes);
    }
    @Override
        return .batchGetItem(spec);
    }
    @Override
            ReturnConsumedCapacity returnConsumedCapacity,
            Map<StringKeysAndAttributesunprocessedKeys) {
                returnConsumedCapacityunprocessedKeys);
    }
    @Override
            Map<StringKeysAndAttributesunprocessedKeys) {
        return .batchGetItemUnprocessed(unprocessedKeys);
    }
    @Override
            TableWriteItems... tableWriteItems) {
        return .batchWriteItem(tableWriteItems);
    }
    @Override
        return .batchWriteItem(spec);
    }
    @Override
            Map<StringList<WriteRequest>> unprocessedItems) {
        return .batchWriteItemUnprocessed(unprocessedItems);
    }

    
Shuts down and release all resources.
    public void shutdown() {
        .shutdown();
    }
New to GrepCode? Check out our FAQ X