com.amazonaws.services.dynamodbv2.util
Class Tables

java.lang.Object
  extended by com.amazonaws.services.dynamodbv2.util.Tables

public class Tables
extends java.lang.Object

Utility methods for working with AWS DynamoDB tables.

 if (Tables.doesTableExist(dynamoDB, myTableName) == false) {
    // ... create your table ...
    Tables.waitForTableToBecomeActive(dynamoDB, myTableName);
 }
 


Constructor Summary
Tables()
           
 
Method Summary
static boolean doesTableExist(AmazonDynamoDB dynamo, java.lang.String tableName)
          Checks if a specified table exists and is in ACTIVE state.
static void waitForTableToBecomeActive(AmazonDynamoDB dynamo, java.lang.String tableName)
          Waits up to 10 minutes for a specified AWS DynamoDB table to move into the ACTIVE state.
static void waitForTableToBecomeActive(AmazonDynamoDB dynamo, java.lang.String tableName, int timeout, int interval)
          Waits up to a specified amount of time for a specified AWS DynamoDB table to move into the ACTIVE state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tables

public Tables()
Method Detail

doesTableExist

public static boolean doesTableExist(AmazonDynamoDB dynamo,
                                     java.lang.String tableName)
Checks if a specified table exists and is in ACTIVE state.

Parameters:
dynamo - The AWS DynamoDB client to use to make requests.
tableName - The name of the table being searched for.
Returns:
True if a table already exists with the specified name, otherwise false.

waitForTableToBecomeActive

public static void waitForTableToBecomeActive(AmazonDynamoDB dynamo,
                                              java.lang.String tableName)
Waits up to 10 minutes for a specified AWS DynamoDB table to move into the ACTIVE state. If the table doesn't transition to the ACTIVE state, then an AmazonClientException is thrown.

Parameters:
dynamo - The AWS DynamoDB client to use to make requests.
tableName - The name of the table whose status is being checked.
Throws:
AmazonClientException - If the specified table does not transition into the ACTIVE state before this method times out and stops polling.

waitForTableToBecomeActive

public static void waitForTableToBecomeActive(AmazonDynamoDB dynamo,
                                              java.lang.String tableName,
                                              int timeout,
                                              int interval)
Waits up to a specified amount of time for a specified AWS DynamoDB table to move into the ACTIVE state. If the table doesn't transition to the ACTIVE state, then an AmazonClientException is thrown.

Parameters:
dynamo - The AWS DynamoDB client to use to make requests.
tableName - The name of the table whose status is being checked.
timeout - The maximum number of milliseconds to wait.
interval - The poll interval in milliseconds.
Throws:
AmazonClientException - If the specified table does not transition into the ACTIVE state before this method times out and stops polling.


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.