コード例 #1
0
 @DELETE
 @Path("/{triggerId}/dampenings/{dampeningId}")
 @ApiOperation(value = "Delete an existing dampening definition")
 @ApiResponses(
     value = {
       @ApiResponse(code = 200, message = "Success, Dampening deleted"),
       @ApiResponse(code = 404, message = "No Dampening found"),
       @ApiResponse(code = 500, message = "Internal server error")
     })
 public Response deleteDampening(
     @ApiParam(value = "Trigger definition id to be deleted", required = true)
         @PathParam("triggerId")
         final String triggerId,
     @ApiParam(value = "Dampening id for dampening definition to be deleted", required = true)
         @PathParam("dampeningId")
         final String dampeningId) {
   try {
     boolean exists = (definitions.getDampening(tenantId, dampeningId) != null);
     if (exists) {
       definitions.removeDampening(tenantId, dampeningId);
       log.debug("DampeningId: " + dampeningId);
       return ResponseUtil.ok();
     } else {
       return ResponseUtil.notFound("Dampening not found for dampeningId: " + dampeningId);
     }
   } catch (Exception e) {
     log.debug(e.getMessage(), e);
     return ResponseUtil.internalError(e.getMessage());
   }
 }