use of org.talend.dataprep.api.service.command.preparation.PreparationDelete in project data-prep by Talend.
the class PreparationAPI method deletePreparation.
@RequestMapping(value = "/api/preparations/{id}", method = DELETE, produces = TEXT_PLAIN_VALUE)
@ApiOperation(value = "Delete a preparation by id", notes = "Delete a preparation content based on provided id. Id should be a UUID returned by the list operation. Not valid or non existing preparation id returns empty content.")
@Timed
public String deletePreparation(@ApiParam(name = "id", value = "The id of the preparation to delete.") @PathVariable("id") String id) {
if (LOG.isDebugEnabled()) {
LOG.debug("Deleting preparation (pool: {} )...", getConnectionStats());
}
final CachePreparationEviction evictPreparationCache = getCommand(CachePreparationEviction.class, id);
final PreparationDelete preparationDelete = getCommand(PreparationDelete.class, id, evictPreparationCache);
final String preparationId = preparationDelete.execute();
if (LOG.isDebugEnabled()) {
LOG.debug("Deleted preparation (pool: {} )...", getConnectionStats());
}
return preparationId;
}
Aggregations