Search in sources :

Example 1 with YOU_DO_NOT_HAVE_PERMISSION_TO_GET_TASK_IDS

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());
}
Also used : TaskInfo(org.ow2.proactive.scheduler.common.task.TaskInfo) TaskId(org.ow2.proactive.scheduler.common.task.TaskId) TaskStatesPage(org.ow2.proactive.scheduler.common.task.TaskStatesPage) Page(org.ow2.proactive.scheduler.common.Page) ImmediateService(org.objectweb.proactive.annotation.ImmediateService)

Aggregations

ImmediateService (org.objectweb.proactive.annotation.ImmediateService)1 Page (org.ow2.proactive.scheduler.common.Page)1 TaskId (org.ow2.proactive.scheduler.common.task.TaskId)1 TaskInfo (org.ow2.proactive.scheduler.common.task.TaskInfo)1 TaskStatesPage (org.ow2.proactive.scheduler.common.task.TaskStatesPage)1