+ newAttributeName + "' starts-with ''] ", nextToken, consistentRead);
return result;
}
private void putAndDelete(String domainName, String oldAttributeName, String newAttributeName, List<Item> items) throws AmazonClientException {
AmazonSimpleDB db = factory.getSimpleDb();
for (Item item : items) {
GetAttributesResult getOldResults = db.getAttributes(new GetAttributesRequest().withDomainName(domainName).withConsistentRead(true).withItemName(
item.getName()).withAttributeNames(oldAttributeName));
List<Attribute> oldAtts = getOldResults.getAttributes();
if (oldAtts.size() > 0) {
Attribute oldAtt = oldAtts.get(0);
List<ReplaceableAttribute> atts = new ArrayList<ReplaceableAttribute>();
atts.add(new ReplaceableAttribute(newAttributeName, oldAtt.getValue(), true));
db.putAttributes(new PutAttributesRequest().withDomainName(domainName).withItemName(item.getName()).withAttributes(atts));
db.deleteAttributes(new DeleteAttributesRequest().withDomainName(domainName).withItemName(item.getName()).withAttributes(oldAtts));
}
}
}