logger.info("Job with ID {} is already COMPLETED.",jobId);
return;
}
if(job.getFuture()!=null){
booleanwasCancelled=job.getFuture().cancel(true);
if(wasCancelled){
job.setState(ExecutionStateType.CANCELLED);
logger.info("Job with ID {} stopped successfully.",jobId);
}else{
job.setState(ExecutionStateType.PENDING);
logger.warn("Job with ID {} could not be stopped because it has already completed, has been cancelled, or could not be cancelled for some other reason.",jobId);
}
}
}else{
logger.warn("Job with ID {} does not exist.",jobId);