Package com.amazonaws.services.dynamodb.model

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


    }

    @Override
    public DeleteItemResult deleteItem(DeleteItemRequest deleteItemRequest) {
        this.deleteItemRequest = deleteItemRequest;
        return new DeleteItemResult().withAttributes(getAttributes());
    }
View Full Code Here


        super(ddbClient, configuration, exchange);
    }

    @Override
    public void execute() {
        DeleteItemResult result = ddbClient.deleteItem(new DeleteItemRequest()
                .withTableName(determineTableName())
                .withKey(determineKey())
                .withReturnValues(determineReturnValues())
                .withExpected(determineUpdateCondition()));

        addAttributesToResult(result.getAttributes());
    }
View Full Code Here

    @Override
    public int delete(String table, String key) {
        logger.debug("deletekey: " + key + " from table: " + table);
        DeleteItemRequest req = new DeleteItemRequest(table, createPrimaryKey(key));
        DeleteItemResult res = null;

        try {
            res = dynamoDB.deleteItem(req);
        }catch (AmazonServiceException ex) {
            logger.error(ex.getMessage());
View Full Code Here

    }

    // Check conditional put
    validateExpected(request.getExpected(), item);

    DeleteItemResult result = new DeleteItemResult().withConsumedCapacityUnits(1D);
    if (item != null && request.getReturnValues() != null && ReturnValue.fromValue(request.getReturnValues()) == ReturnValue.ALL_OLD) {
      result.setAttributes(item);
    }

    // remove the item from the table
    table.removeItem(hashKey, rangeKey);
    return result;
View Full Code Here

  }

  public com.amazonaws.services.dynamodbv2.model.DeleteItemResult deleteItemV2(com.amazonaws.services.dynamodbv2.model.DeleteItemRequest v2Request) {
        Table table = this.tables.get(v2Request.getTableName());
        DeleteItemRequest request = AlternatorDBApiVersion2Mapper.MapV2DeleteItemRequestToV1(v2Request, table);
        DeleteItemResult result = deleteItem(request);
        return AlternatorDBApiVersion2Mapper.MapV1DeleteItemResultToV2(result, v2Request.getTableName());
  }
View Full Code Here

        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);
        AttributeValue hash = new AttributeValue("ad"); //createStringAttribute();
        getClient().putItem(new PutItemRequest().withTableName(tableName).withItem(createGenericItem(hash)));
        DeleteItemRequest request = new DeleteItemRequest().withTableName(tableName).withKey(new Key(hash));
        DeleteItemResult result = getClient().deleteItem(request);
        Assert.assertNotNull(result.getConsumedCapacityUnits());
    }
View Full Code Here

        getClient().putItem(new PutItemRequest().withTableName(tableName).withItem(createGenericItem(hash, range2)));
        Key key1 = new Key().withHashKeyElement(hash).withRangeKeyElement(range1);
        Key key2 = new Key().withHashKeyElement(hash).withRangeKeyElement(range2);
        DeleteItemRequest request1 = new DeleteItemRequest().withTableName(tableName).withKey(key1).withReturnValues(ReturnValue.ALL_OLD);
        DeleteItemRequest request2 = new DeleteItemRequest().withTableName(tableName).withKey(key2).withReturnValues(ReturnValue.ALL_OLD);
        DeleteItemResult result = getClient().deleteItem(request1);
        Assert.assertNotNull(result.getAttributes());
        result = getClient().deleteItem(request2);
        Assert.assertNotNull(result.getAttributes());
    }
View Full Code Here

TOP

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

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.