/** * Delete an existing scheduled task. * * @param scheduledServiceId The scheduled task to access. */ @Override @DELETE @ResourceMethodSignature(pathParams = {@PathParam(ScheduledServicePlexusResource.SCHEDULED_SERVICE_ID_KEY)}) public void delete(Context context, Request request, Response response) throws ResourceException { try { getNexusScheduler().getTaskById(getScheduledServiceId(request)).cancel(); response.setStatus(Status.SUCCESS_NO_CONTENT); } catch (NoSuchTaskException e) { response.setStatus(Status.CLIENT_ERROR_NOT_FOUND, "Scheduled service not found!"); } }
/** * Delete an existing scheduled task. * * @param scheduledServiceId The scheduled task to access. */ @Override @DELETE @ResourceMethodSignature( pathParams = { @PathParam( ScheduledServicePlexusResource.SCHEDULED_SERVICE_ID_KEY ) } ) public void delete( Context context, Request request, Response response ) throws ResourceException { try { getNexusScheduler().getTaskById( getScheduledServiceId( request ) ).cancel(); response.setStatus( Status.SUCCESS_NO_CONTENT ); } catch ( NoSuchTaskException e ) { response.setStatus( Status.CLIENT_ERROR_NOT_FOUND, "Scheduled service not found!" ); } }