use of org.ow2.proactive.scheduler.core.SchedulerFrontendState.YOU_DO_NOT_HAVE_PERMISSION_TO_KILL_THIS_JOB in project scheduling by ow2-proactive.
the class SchedulerFrontend method killJobs.
@Override
@ImmediateService
public boolean killJobs(List<String> jobIds) throws NotConnectedException, PermissionException {
if (jobIds.isEmpty()) {
return false;
}
String currentUser = frontendState.getCurrentUser();
List<JobId> jobIdsConverted = jobIds.stream().map(JobIdImpl::makeJobId).collect(Collectors.toList());
// checking permission for each of the job
for (JobId jobId : jobIdsConverted) {
try {
frontendState.checkPermissions("killJob", frontendState.getIdentifiedJob(jobId), YOU_DO_NOT_HAVE_PERMISSION_TO_KILL_THIS_JOB);
} catch (UnknownJobException e) {
logger.debug(e);
}
}
logger.info("Request to kill jobs " + jobIds + " received from " + currentUser);
return schedulingService.killJobs(jobIdsConverted);
}
Aggregations