List of usage examples for com.amazonaws.services.simpledb.model PutAttributesRequest getAttributes
public java.util.List<ReplaceableAttribute> getAttributes()
From source file:br.com.ingenieux.mojo.simpledb.cmd.PutAttributesCommand.java
License:Apache License
private void putAttribute(PutAttributesContext ctx, ObjectNode objectNode) { PutAttributesRequest request = new PutAttributesRequest(); request.setDomainName(ctx.getDomain()); Iterator<String> itFieldName = objectNode.fieldNames(); while (itFieldName.hasNext()) { String key = itFieldName.next(); if ("name".equals(key)) { String value = objectNode.get("name").textValue(); request.setItemName(value);/*from ww w .ja v a 2s . c om*/ } else if ("append".equals(key) || "replace".equals(key)) { boolean replaceP = "replace".equals(key); ArrayNode attributesNode = (ArrayNode) objectNode.get(key); Collection<ReplaceableAttribute> value = getAttributesFrom(attributesNode, replaceP); request.getAttributes().addAll(value); } else if ("expect".equals(key)) { ObjectNode expectNode = (ObjectNode) objectNode.get("expect"); request.setExpected(getUpdateCondition(expectNode)); } } service.putAttributes(request); }