List of usage examples for com.amazonaws.services.simpledb.model ReplaceableItem setAttributes
public void setAttributes(java.util.Collection<ReplaceableAttribute> attributes)
From source file:org.teiid.resource.adpter.simpledb.SimpleDbAPIClass.java
License:Open Source License
/** * Performs update on given domain and items * @param domainName/*from ww w. ja v a 2 s .c om*/ * @param items */ public void performUpdate(String domainName, Map<String, Map<String, String>> items) { List<ReplaceableItem> itemsList = new ArrayList<ReplaceableItem>(); for (Map.Entry<String, Map<String, String>> item : items.entrySet()) { ReplaceableItem it = new ReplaceableItem(item.getKey()); List<ReplaceableAttribute> attributesList = new ArrayList<ReplaceableAttribute>(); for (Map.Entry<String, String> attribute : item.getValue().entrySet()) { attributesList.add(new ReplaceableAttribute(attribute.getKey(), attribute.getValue(), true)); } it.setAttributes(attributesList); itemsList.add(it); } BatchPutAttributesRequest req = new BatchPutAttributesRequest(domainName, itemsList); client.batchPutAttributes(req); }