/** * Cancel the execution of an existing scheduled task. * * @param scheduledServiceId The scheduled task to cancel. */ @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)).cancelOnly(); response.setStatus(Status.SUCCESS_NO_CONTENT); } catch (NoSuchTaskException e) { response.setStatus(Status.CLIENT_ERROR_NOT_FOUND, "Scheduled service not found!"); } }
/** * Cancel the execution of an existing scheduled task. * * @param scheduledServiceId The scheduled task to cancel. */ @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 ) ).cancelOnly(); response.setStatus( Status.SUCCESS_NO_CONTENT ); } catch ( NoSuchTaskException e ) { response.setStatus( Status.CLIENT_ERROR_NOT_FOUND, "Scheduled service not found!" ); } }