Package com.amazonaws.services.dynamodbv2.model

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


    @Override
    @Cacheable.FlushBefore
    public boolean remove(@NotNull final Domain domain) {
        final AmazonDynamoDB amazon = this.client.get();
        amazon.deleteItem(
            new DeleteItemRequest(
                this.table,
                new ImmutableMap.Builder<String, AttributeValue>()
                    .put(DefaultDynamo.NAME, new AttributeValue(domain.name()))
                    .build()
            )
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());
        }

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

  private void deleteRow(String key, String cf) {
    if (StringUtils.isBlank(key) || StringUtils.isBlank(cf)) {
      return;
    }
    try {
      DeleteItemRequest delItemRequest = new DeleteItemRequest(cf,
          Collections.singletonMap(Config._KEY, new AttributeValue(key)));
      client().deleteItem(delItemRequest);
    } catch (Exception e) {
      logger.error(null, e);
    }
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());
        }

        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

            if ( !requestItems.containsKey(tableName) ) {
                requestItems.put(tableName, new LinkedList<WriteRequest>());
            }

            requestItems.get(tableName).add(
                    new WriteRequest().withDeleteRequest(new DeleteRequest().withKey(key)));
        }

        // Break into chunks of 25 items and make service requests to DynamoDB
        while ( !requestItems.isEmpty() ) {
            HashMap<String, List<WriteRequest>> batch = new HashMap<String, List<WriteRequest>>();
View Full Code Here

        Map<String, ExpectedAttributeValue> expectedValues = new HashMap<String, ExpectedAttributeValue>();

        String hashKeyAttributeName = reflector.getAttributeName(hashKeyGetter);
        Object hashGetterResult = safeInvoke(hashKeyGetter, object);
        attributes.put(hashKeyAttributeName, getSimpleAttributeValue(hashKeyGetter, hashGetterResult));
        expectedValues.put(hashKeyAttributeName, new ExpectedAttributeValue().withExists(false));

        if (rangeKeyGetter != null) {
            String rangeKeyAttributeName = reflector.getAttributeName(rangeKeyGetter);
            Object rangeGetterResult = safeInvoke(rangeKeyGetter, object);
            attributes.put(rangeKeyAttributeName, getSimpleAttributeValue(rangeKeyGetter, rangeGetterResult));
            expectedValues.put(rangeKeyAttributeName, new ExpectedAttributeValue().withExists(false));
        }
        attributes = transformAttributes(clazz, attributes);
        db.putItem(applyUserAgent(new PutItemRequest().withTableName(tableName).withItem(attributes)
                .withExpected(expectedValues)));
    }
View Full Code Here

                if ( reflector.isVersionAttributeGetter(method) ) {
                    Object getterResult = safeInvoke(method, object);
                    String attributeName = reflector.getAttributeName(method);

                    ExpectedAttributeValue expected = new ExpectedAttributeValue();
                    AttributeValue currentValue = getSimpleAttributeValue(method, getterResult);
                    expected.setExists(currentValue != null);
                    if ( currentValue != null )
                        expected.setValue(currentValue);
                    expectedValues.put(attributeName, expected);
                    break;
                }
            }
        }
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.