Examples of DeleteTableRequest


Examples of com.amazonaws.services.dynamodb.model.DeleteTableRequest

  @Test
  public void deleteTableWithoutName() {
    String name = createTableName();
    createTable(name);
    try {
      DeleteTableResult res = getClient().deleteTable(new DeleteTableRequest());
      Assert.assertTrue(false);// Should have thrown an exception
    } catch (AmazonServiceException ase) {
    }
    Assert.assertTrue(getClient().listTables().getTableNames().contains(name));
  }
View Full Code Here

Examples of com.amazonaws.services.dynamodb.model.DeleteTableRequest

        }
    }

    @After
    public void tearDown() throws Exception {
        DeleteTableRequest del = new DeleteTableRequest();
        del.setTableName("Testing");
    try {
      getClient().deleteTable(del);
    } catch (ResourceNotFoundException rnfe) {

    }
View Full Code Here

Examples of com.amazonaws.services.dynamodb.model.DeleteTableRequest

  protected void deleteAllTables() {
    String lastTableName = null;
    while (true) {
      ListTablesResult res = getClient().listTables(new ListTablesRequest().withExclusiveStartTableName(lastTableName));
      for (String tableName : res.getTableNames()) {
        getClient().deleteTable(new DeleteTableRequest(tableName));
      }
      lastTableName = res.getLastEvaluatedTableName();
      if (lastTableName == null) {
        break;
      }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.DeleteTableRequest

     * @param tableName
     *        The Amazon DynamoDB table to delete
     */
    public static void deleteTable(AmazonDynamoDBClient client, String tableName) {
        if (tableExists(client, tableName)) {
            DeleteTableRequest deleteTableRequest = new DeleteTableRequest();
            deleteTableRequest.setTableName(tableName);
            client.deleteTable(deleteTableRequest);
            LOG.info("Deleted table " + tableName);
        } else {
            LOG.warn("Table " + tableName + " does not exist");
        }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.DeleteTableRequest

  public static boolean deleteTable(String appid) {
    if (StringUtils.isBlank(appid) || !existsTable(appid)) {
      return false;
    }
    try {
      getClient().deleteTable(new DeleteTableRequest().withTableName(appid));
    } catch (Exception e) {
      logger.error(null, e);
      return false;
    }
    return true;
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.DeleteTableRequest

import com.fasterxml.jackson.core.JsonToken;

public class DeleteTableRequestJsonUnmarshaller implements Unmarshaller<DeleteTableRequest, JsonUnmarshallerContext> {

    public DeleteTableRequest unmarshall(JsonUnmarshallerContext context) throws Exception {
        DeleteTableRequest request = new DeleteTableRequest();

        int originalDepth = context.getCurrentDepth();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.currentToken;
        if (token == null) token = context.nextToken();

        while (true) {
            if (token == null) break;

            if (token == JsonToken.FIELD_NAME || token == JsonToken.START_OBJECT) {
                if (context.testExpression("TableName", targetDepth)) {
                    context.nextToken();
                    request.setTableName(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance().unmarshall(context));
                }
            } else if (token == JsonToken.END_ARRAY || token == JsonToken.END_OBJECT) {
                if (context.getCurrentDepth() <= originalDepth) break;
            }
            token = context.nextToken();
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.DeleteTableRequest

  protected void deleteAllTables() {
    String lastTableName = null;
    while (true) {
      ListTablesResult res = getClient().listTables(new ListTablesRequest().withExclusiveStartTableName(lastTableName));
      for (String tableName : res.getTableNames()) {
        getClient().deleteTable(new DeleteTableRequest(tableName));
      }
      lastTableName = res.getLastEvaluatedTableName();
      if (lastTableName == null) {
        break;
      }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.DeleteTableRequest

        }
    }

    @After
    public void tearDown() throws Exception {
        DeleteTableRequest del = new DeleteTableRequest();
        del.setTableName("Testing");
    try {
      getClient().deleteTable(del);
    } catch (ResourceNotFoundException rnfe) {

    }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.DeleteTableRequest

  @Test
  public void deleteTableTest() {
    String name = createTableName();
    createTable(name);
    getClient().deleteTable(new DeleteTableRequest(name));
    ListTablesResult res = getClient().listTables();
    Assert.assertFalse(res.getTableNames().contains(name));
    Assert.assertTrue(res.getTableNames().size() == 0);
  }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.DeleteTableRequest

  @Test
  public void deleteTableWithoutName() {
    String name = createTableName();
    createTable(name);
    try {
      DeleteTableResult res = getClient().deleteTable(new DeleteTableRequest());
      Assert.assertTrue(false);// Should have thrown an exception
    } catch (AmazonServiceException ase) {
    }
    Assert.assertTrue(getClient().listTables().getTableNames().contains(name));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.