Examples of PutItemRequest


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

        /*
         * Do a put or an update, according to the configuration. For a put (not
         * the default), we need to munge the data type.
         */
        if ( config.getSaveBehavior() == SaveBehavior.CLOBBER || forcePut ) {
            db.putItem(applyUserAgent(new PutItemRequest().withTableName(tableName).withItem(convertToItem(updateValues))
                    .withExpected(expectedValues)));
        } else {
            db.updateItem(applyUserAgent(new UpdateItemRequest().withTableName(tableName).withKey(objectKey)
                    .withAttributeUpdates(updateValues).withExpected(expectedValues)));
        }
View Full Code Here

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

                }

                @Override
                protected void executeLowLevelRequest(boolean onlyKeyAttributeSpecified) {
                    /* Send a putItem request */
                    db.putItem(applyUserAgent(new PutItemRequest().withTableName(getTableName())
                            .withItem(transformAttributes(this.clazz, convertToItem(getAttributeValueUpdates())))
                            .withExpected(getExpectedAttributeValues())));
                }
            };
        } else {
View Full Code Here

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

            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

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

                }

                @Override
                protected void executeLowLevelRequest(boolean onlyKeyAttributeSpecified) {
                    /* Send a putItem request */
                    db.putItem(applyUserAgent(new PutItemRequest().withTableName(getTableName())
                            .withItem(transformAttributes(this.clazz, convertToItem(getAttributeValueUpdates())))
                            .withExpected(getExpectedAttributeValues())));
                }
            };
        } else {
View Full Code Here

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

            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

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

                    Map<String, AttributeValue> attributeValues =
                            convertToItem(getAttributeValueUpdates());

                    attributeValues = transformAttributes(
                        toParameters(attributeValues, this.clazz, finalConfig));
                    PutItemRequest req = new PutItemRequest()
                        .withTableName(getTableName())
                        .withItem(attributeValues)
                        .withExpected(getExpectedAttributeValues())
                        .withRequestMetricCollector(
                            finalConfig.getRequestMetricCollector());
View Full Code Here

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

        //overlay any user provided expected values.
        if(userProvidedExpectedValues != null){
            expectedValues.putAll(userProvidedExpectedValues);
        }
        PutItemRequest req = new PutItemRequest().withTableName(tableName)
            .withItem(attributes).withExpected(expectedValues)
            .withRequestMetricCollector(config.getRequestMetricCollector());
        db.putItem(applyUserAgent(req));
   }
View Full Code Here

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

            attributeValues = transformAttributes(
                    toParameters(attributeValues,
                                 this.clazz,
                                 saveConfig));
            PutItemRequest req = new PutItemRequest()
                    .withTableName(getTableName())
                    .withItem(attributeValues)
                    .withExpected(mergeExpectedAttributeValueConditions())
                    .withConditionalOperator(userProvidedConditionOperator)
                    .withRequestMetricCollector(saveConfig.getRequestMetricCollector());
View Full Code Here

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

            TableDescription tableDescription = dynamoDB.describeTable(describeTableRequest).getTable();
            System.out.println("Table Description: " + tableDescription);

            // Add an item
            Map<String, AttributeValue> item = newItem("Bill & Ted's Excellent Adventure", 1989, "****", "James", "Sara");
            PutItemRequest putItemRequest = new PutItemRequest(tableName, item);
            PutItemResult putItemResult = dynamoDB.putItem(putItemRequest);
            System.out.println("Result: " + putItemResult);

            // Add another item
            item = newItem("Airplane", 1980, "*****", "James", "Billy Bob");
            putItemRequest = new PutItemRequest(tableName, item);
            putItemResult = dynamoDB.putItem(putItemRequest);
            System.out.println("Result: " + putItemResult);

            // Scan items for movies with a year attribute greater than 1985
            HashMap<String, Condition> scanFilter = new HashMap<String, Condition>();
View Full Code Here

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

    private String conditionExpression;
    private Map<String, String> nameMap;
    private Map<String, Object> valueMap;

    public PutItemSpec() {
        super(new PutItemRequest());
    }
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.