use of com.amazonaws.services.dynamodbv2.model.PutItemResult in project camel by apache.
the class PutItemCommand method execute.
@Override
public void execute() {
PutItemResult result = ddbClient.putItem(new PutItemRequest().withTableName(determineTableName()).withItem(determineItem()).withExpected(determineUpdateCondition()).withReturnValues(determineReturnValues()));
addAttributesToResult(result.getAttributes());
}
use of com.amazonaws.services.dynamodbv2.model.PutItemResult in project cas by apereo.
the class DynamoDbServiceRegistryFacilitator method put.
/**
* Put.
*
* @param service the service
*/
public void put(final RegisteredService service) {
final Map<String, AttributeValue> values = buildTableAttributeValuesMapFromService(service);
final PutItemRequest putItemRequest = new PutItemRequest(TABLE_NAME, values);
LOGGER.debug("Submitting put request [{}] for service id [{}]", putItemRequest, service.getServiceId());
final PutItemResult putItemResult = amazonDynamoDBClient.putItem(putItemRequest);
LOGGER.debug("Service added with result [{}]", putItemResult);
}
use of com.amazonaws.services.dynamodbv2.model.PutItemResult in project cas by apereo.
the class DynamoDbTicketRegistryFacilitator method put.
/**
* Put ticket.
*
* @param ticket the ticket
* @param encodedTicket the encoded ticket
*/
public void put(final Ticket ticket, final Ticket encodedTicket) {
final TicketDefinition metadata = this.ticketCatalog.find(ticket);
final Map<String, AttributeValue> values = buildTableAttributeValuesMapFromTicket(ticket, encodedTicket);
LOGGER.debug("Adding ticket id [{}] with attribute values [{}]", encodedTicket.getId(), values);
final PutItemRequest putItemRequest = new PutItemRequest(metadata.getProperties().getStorageName(), values);
LOGGER.debug("Submitting put request [{}] for ticket id [{}]", putItemRequest, encodedTicket.getId());
final PutItemResult putItemResult = amazonDynamoDBClient.putItem(putItemRequest);
LOGGER.debug("Ticket added with result [{}]", putItemResult);
getAll();
}
Aggregations