Examples of DeleteItemResult


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

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

        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

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

    @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

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

    }

    // 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

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

  }

  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

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

        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

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

        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

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

            .withConditionExpression(spec.getConditionExpression())
            .withExpected(expectedMap)
            .withExpressionAttributeNames(spec.getNameMap())
            .withExpressionAttributeValues(attrValMap)
            ;
        DeleteItemResult result = getClient().deleteItem(req);
        return new DeleteItemOutcome(result);
    }
View Full Code Here

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

    AttributeValue hashKeyValue = new AttributeValue().withN(String.valueOf(hashKey));
    deleteItemRequest.getKey().put(config.getHashKeyAttributeName(), hashKeyValue);
    deleteItemRequest.getKey().put(config.getRangeKeyAttributeName(), deletePointRequest.getRangeKeyValue());

    DeleteItemResult deleteItemResult = config.getDynamoDBClient().deleteItem(deleteItemRequest);
    DeletePointResult deletePointResult = new DeletePointResult(deleteItemResult);

    return deletePointResult;
  }
View Full Code Here

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

        createGenericTable(tableName);

        AttributeValue hash = new AttributeValue("ad"); //createStringAttribute();
        getClient().putItem(new PutItemRequest().withTableName(tableName).withItem(createGenericItem(hash)));
        DeleteItemRequest request = new DeleteItemRequest().withTableName(tableName).withKey(createItemKey("id", hash));
        DeleteItemResult res = getClient().deleteItem(request);

        Assert.assertNotNull(res.getConsumedCapacity());
        Assert.assertEquals(tableName, res.getConsumedCapacity().getTableName());
        Assert.assertNotNull(res.getConsumedCapacity().getCapacityUnits());
    }
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.