Package com.amazonaws.services.dynamodb.model

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


   * Executes a delete table request using the DynamoDB client
   * @param tableName
   */
  public void executeDeleteTableRequest(String pTableName){
    try{
      DeleteTableRequest deleteTableRequest = new DeleteTableRequest().withTableName(pTableName);
      DeleteTableResult result = dynamoDBClient.deleteTable(deleteTableRequest);
      waitForTableToBeDeleted(pTableName);
      LOG.debug("Schema: " + result.getTableDescription() + " deleted successfully.");
    }
    catch(Exception e){
View Full Code Here


    }

    @Override
    public void execute() {
        TableDescription tableDescription = ddbClient
                .deleteTable(new DeleteTableRequest(determineTableName())).getTableDescription();

        addToResult(DdbConstants.PROVISIONED_THROUGHPUT, tableDescription.getProvisionedThroughput());
        addToResult(DdbConstants.CREATION_DATE, tableDescription.getCreationDateTime());
        addToResult(DdbConstants.ITEM_COUNT, tableDescription.getItemCount());
        addToResult(DdbConstants.KEY_SCHEMA, tableDescription.getKeySchema());
View Full Code Here

   * Executes a delete table request using the DynamoDB client
   * @param tableName
   */
  public void executeDeleteTableRequest(String pTableName){
    try{
      DeleteTableRequest deleteTableRequest = new DeleteTableRequest().withTableName(pTableName);
      DeleteTableResult result = dynamoDBClient.deleteTable(deleteTableRequest);
      waitForTableToBeDeleted(pTableName);
      LOG.debug("Schema: " + result.getTableDescription() + " deleted successfully.");
    }
    catch(Exception e){
View Full Code Here

       
        return elem.withAttributeName(field.getName()).withAttributeType(attrType);
    }

    public void deleteTable(String tableName) {
        ddbClient.deleteTable(new DeleteTableRequest(tableName));
    }
View Full Code Here

   * Executes a delete table request using the DynamoDB client
   * @param tableName
   */
  public void executeDeleteTableRequest(String pTableName){
    try{
      DeleteTableRequest deleteTableRequest = new DeleteTableRequest().withTableName(pTableName);
      DeleteTableResult result = dynamoDBClient.deleteTable(deleteTableRequest);
      waitForTableToBeDeleted(pTableName);
      LOG.debug("Schema: " + result.getTableDescription() + " deleted successfully.");
    }
    catch(Exception e){
View Full Code Here

    }

    public static DeleteTableRequest MapV2DeleteTableRequestToV1(
            com.amazonaws.services.dynamodbv2.model.DeleteTableRequest v2Request) {

        DeleteTableRequest request =
            new DeleteTableRequest()
                .withTableName(v2Request.getTableName())
                ;
        return request;
    }
View Full Code Here

  public Boolean supports(Class clazz) {
    return DescribeTableRequest.class.isAssignableFrom(clazz);
  }

  public List<Error> validate(Object target) {
    DeleteTableRequest instance = (DeleteTableRequest) target;
    List<Error> errors = ValidatorUtils.rejectIfNullOrEmptyOrWhitespace(instance.getTableName());
    if(instance.getTableName() != null) {
      errors.addAll(ValidatorUtils.invokeValidator(new TableNameValidator(), instance.getTableName()));
    }
    return removeNulls(errors);
  }
View Full Code Here

    return new DeleteTableResult().withTableDescription(table.getTableDescription().withTableStatus(TableStatus.DELETING));
  }

  public com.amazonaws.services.dynamodbv2.model.DeleteTableResult deleteTableV2(com.amazonaws.services.dynamodbv2.model.DeleteTableRequest v2Request) throws InternalServerErrorException, ResourceNotFoundException {
        DeleteTableRequest request = AlternatorDBApiVersion2Mapper.MapV2DeleteTableRequestToV1(v2Request);
        try {
            DeleteTableResult result = deleteTable(request);
            return AlternatorDBApiVersion2Mapper.MapV1DeleteTableResultToV2(result);
        } catch (ResourceNotFoundException ex) {
            throw new com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException(ex.getMessage());
View Full Code Here

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

  @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

TOP

Related Classes of com.amazonaws.services.dynamodb.model.DeleteTableRequest

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.