Package com.amazonaws.services.dynamodbv2.model

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


                    internalAssertions, deleteExpression.getExpected(),
                    deleteExpression.getConditionalOperator());
            conditionOperator = deleteExpression.getConditionalOperator();
        }

        DeleteItemRequest req = applyUserAgent(new DeleteItemRequest()
            .withKey(key).withTableName(tableName)
            .withExpected(expectedValues))
            .withConditionalOperator(conditionOperator)
            .withRequestMetricCollector(config.getRequestMetricCollector())
            ;
View Full Code Here


                    break;
                }
            }
        }

        db.deleteItem(applyUserAgent(new DeleteItemRequest().withKey(key).withTableName(tableName).withExpected(expectedValues)));
    }
View Full Code Here

        //Overlay any user provided expected values onto the generated ones
        if(deleteExpression != null && deleteExpression.getExpected() != null){
            expectedValues.putAll(deleteExpression.getExpected());
        }

        DeleteItemRequest req = applyUserAgent(new DeleteItemRequest()
            .withKey(key).withTableName(tableName)
            .withExpected(expectedValues))
            .withRequestMetricCollector(config.getRequestMetricCollector())
            ;
        db.deleteItem(req);
View Full Code Here

        //Overlay any user provided expected values onto the generated ones
        if(deleteExpression != null && deleteExpression.getExpected() != null){
            expectedValues.putAll(deleteExpression.getExpected());
        }

        db.deleteItem(applyUserAgent(new DeleteItemRequest().withKey(key).withTableName(tableName).withExpected(expectedValues)));
    }
View Full Code Here

                    break;
                }
            }
        }

        db.deleteItem(applyUserAgent(new DeleteItemRequest().withKey(key).withTableName(tableName).withExpected(expectedValues)));
    }
View Full Code Here

import com.fasterxml.jackson.core.JsonToken;

public class DeleteItemRequestJsonUnmarshaller implements Unmarshaller<DeleteItemRequest, JsonUnmarshallerContext> {

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

    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));
        }
        if (context.testExpression("Key", targetDepth)) {
                    request.setKey(new MapUnmarshaller<String, AttributeValue>(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance(), AttributeValueJsonUnmarshaller.getInstance()).unmarshall(context));
        }
        if (context.testExpression("Expected", targetDepth)) {
          request.setExpected(new MapUnmarshaller<String, ExpectedAttributeValue>(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance(), ExpectedAttributeValueJsonUnmarshaller.getInstance()).unmarshall(context));
        }
        if (context.testExpression("ReturnValues", targetDepth)) {
          context.nextToken();
          request.setReturnValues(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

    public void deleteItem() {
        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

        AttributeValue range1 = new AttributeValue().withN("1");
        AttributeValue range2 = new AttributeValue().withN("2");
        getClient().putItem(new PutItemRequest().withTableName(tableName).withItem(createGenericItem(hash, range1)));
        getClient().putItem(new PutItemRequest().withTableName(tableName).withItem(createGenericItem(hash, range2)));

        DeleteItemRequest request1 = new DeleteItemRequest().withTableName(tableName).withKey(createItemKey("id", hash, "range", range1)).withReturnValues(ReturnValue.ALL_OLD);
        DeleteItemRequest request2 = new DeleteItemRequest().withTableName(tableName).withKey(createItemKey("id", hash, "range", range2)).withReturnValues(ReturnValue.ALL_OLD);
        DeleteItemResult result = getClient().deleteItem(request1);

        Assert.assertNotNull(result.getAttributes());

        result = getClient().deleteItem(request2);
View Full Code Here

    public void deleteItemWithoutTableName() {
        createGenericTable(tableName);

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

    try {
      getClient().deleteItem(request);
      Assert.assertTrue(false);// Should have thrown an exception
    } catch (AmazonServiceException ase) {
View Full Code Here

    @Test
    public void deleteNonExistentItem() {
        createGenericTable(tableName);

        DeleteItemRequest request = new DeleteItemRequest().withTableName(tableName).withKey(createItemKey("id", createStringAttribute()));
    try {
      getClient().deleteItem(request);
      Assert.assertTrue(false);// Should have thrown an exception
    } catch (AmazonServiceException ase) {
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodbv2.model.DeleteItemRequest

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.