use of org.ow2.proactive.scheduler.core.SchedulerFrontendState.YOU_DO_NOT_HAVE_PERMISSION_TO_GET_TASK_IDS in project scheduling by ow2-proactive.
the class SchedulerFrontend method getTaskIds.
@Override
@ImmediateService
public Page<TaskId> getTaskIds(String taskTag, long from, long to, boolean mytasks, Set<TaskStatus> taskStatuses, int offset, int limit) throws NotConnectedException, PermissionException {
String userName = null;
String tmpUserName = frontendState.checkPermission("getTaskIds", YOU_DO_NOT_HAVE_PERMISSION_TO_GET_TASK_IDS).getUsername();
if (mytasks) {
userName = tmpUserName;
}
Page<TaskInfo> pTaskInfo = dbManager.getTasks(from, to, taskTag, offset, limit, userName, taskStatuses);
List<TaskId> lTaskId = new ArrayList<>(pTaskInfo.getList().size());
for (TaskInfo taskInfo : pTaskInfo.getList()) {
if (checkJobPermissionMethod(taskInfo.getJobId().value(), "getTaskIds")) {
lTaskId.add(taskInfo.getTaskId());
}
}
return new Page<>(lTaskId, pTaskInfo.getSize());
}
Aggregations