Search in sources :

Example 1 with PreparationDelete

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;
}
Also used : PreparationDelete(org.talend.dataprep.api.service.command.preparation.PreparationDelete) CachePreparationEviction(org.talend.dataprep.api.service.command.preparation.CachePreparationEviction) Timed(org.talend.dataprep.metrics.Timed) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 CachePreparationEviction (org.talend.dataprep.api.service.command.preparation.CachePreparationEviction)1 PreparationDelete (org.talend.dataprep.api.service.command.preparation.PreparationDelete)1 Timed (org.talend.dataprep.metrics.Timed)1