use of org.jumpmind.symmetric.web.rest.model.BatchAckResults in project symmetric-ds by JumpMind.
the class RestService method putAcknowledgeBatch.
@ApiOperation(value = "Acknowledge a set of batches for the specified engine")
@RequestMapping(value = "/engine/{engine}/acknowledgebatch", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public final BatchAckResults putAcknowledgeBatch(@PathVariable("engine") String engineName, @ApiParam(value = "This the password for the nodeId being passed in. The password is stored in the node_security table.") @RequestParam(value = WebConstants.SECURITY_TOKEN) String securityToken, @RequestBody BatchResults batchResults) {
BatchAckResults finalResult = new BatchAckResults();
ISymmetricEngine engine = getSymmetricEngine(engineName);
List<BatchAckResult> results = null;
if (batchResults.getBatchResults().size() > 0) {
if (securityVerified(batchResults.getNodeId(), engine, securityToken)) {
IAcknowledgeService ackService = engine.getAcknowledgeService();
List<BatchAck> batchAcks = convertBatchResultsToAck(batchResults);
results = ackService.ack(batchAcks);
} else {
throw new NotAllowedException();
}
}
finalResult.setBatchAckResults(results);
return finalResult;
}
Aggregations