Examples of DeleteItemRequest


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

    private DeleteItemOutcome doDeleteItem(DeleteItemSpec spec) {
        // set the table name
        final String tableName = getTable().getTableName();
        // set up the keys
        DeleteItemRequest req = spec.getRequest().withTableName(tableName)
            .withKey(InternalUtils.toAttributeValueMap(spec.getKeyComponents()));
        // set up the expected attribute map, if any
        final Collection<Expected> expected = spec.getExpected();
        final Map<String, ExpectedAttributeValue> expectedMap =
            InternalUtils.toExpectedAttributeValueMap(expected);
        // set up the value map, if any (when expression API is used)
        final Map<String,AttributeValue> attrValMap =
            InternalUtils.fromSimpleMap(spec.getValueMap());
        // set up the request
        req.withConditionalOperator(spec.getConditionalOperator())
            .withConditionExpression(spec.getConditionExpression())
            .withExpected(expectedMap)
            .withExpressionAttributeNames(spec.getNameMap())
            .withExpressionAttributeValues(attrValMap)
            ;
View Full Code Here

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

  private void deleteRow(String key, String appid) {
    if (StringUtils.isBlank(key) || StringUtils.isBlank(appid)) {
      return;
    }
    try {
      DeleteItemRequest delItemRequest = new DeleteItemRequest(appid,
          Collections.singletonMap(Config._KEY, new AttributeValue(key)));
      client().deleteItem(delItemRequest);
    } catch (Exception e) {
      logger.error(null, e);
    }
View Full Code Here

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

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

  public DeletePointResult deletePoint(DeletePointRequest deletePointRequest) {
    long geohash = S2Manager.generateGeohash(deletePointRequest.getGeoPoint());
    long hashKey = S2Manager.generateHashKey(geohash, config.getHashKeyLength());

    DeleteItemRequest deleteItemRequest = deletePointRequest.getDeleteItemRequest();

    deleteItemRequest.setTableName(config.getTableName());

    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.DeleteItemRequest

  private void deleteRow(String key, String appid) {
    if (StringUtils.isBlank(key) || StringUtils.isBlank(appid)) {
      return;
    }
    try {
      DeleteItemRequest delItemRequest = new DeleteItemRequest(appid,
          Collections.singletonMap(Config._KEY, new AttributeValue(key)));
      client().deleteItem(delItemRequest);
    } catch (Exception e) {
      logger.error(null, e);
    }
View Full Code Here

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

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

    public static void deleteSession(AmazonDynamoDB dynamo, String tableName, String sessionId) {
        Map<String, AttributeValue> key = newAttributeValueMap();
        key.put(SessionTableAttributes.SESSION_ID_KEY, new AttributeValue(sessionId));

        DeleteItemRequest request = new DeleteItemRequest(tableName, key);
        addClientMarker(request);

        try {
            dynamo.deleteItem(request);
        } catch (Exception e) {
View Full Code Here

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

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

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

  private DeleteItemRequest deleteItemRequest;
  private GeoPoint geoPoint;
  private AttributeValue rangeKeyValue;

  public DeletePointRequest(GeoPoint geoPoint, AttributeValue rangeKeyValue) {
    deleteItemRequest = new DeleteItemRequest();
    deleteItemRequest.setKey(new HashMap<String, AttributeValue>());

    this.geoPoint = geoPoint;
    this.rangeKeyValue = rangeKeyValue;
  }
View Full Code Here

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

                    break;
                }
            }
        }

        db.deleteItem(applyUserAgent(new DeleteItemRequest().withKey(key).withTableName(tableName).withExpected(expectedValues)));
    }
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.