Search in sources :

Example 1 with YOU_DO_NOT_HAVE_PERMISSION_TO_GET_TASK_STATES

use of org.ow2.proactive.scheduler.core.SchedulerFrontendState.YOU_DO_NOT_HAVE_PERMISSION_TO_GET_TASK_STATES in project scheduling by ow2-proactive.

the class SchedulerFrontend method getTaskStates.

@Override
@ImmediateService
public Page<TaskState> getTaskStates(String taskTag, long from, long to, boolean mytasks, Set<TaskStatus> statusFilter, int offset, int limit, SortSpecifierContainer sortParams) throws NotConnectedException, PermissionException {
    String userName = null;
    String tmpUserName = frontendState.checkPermission("getTaskStates", YOU_DO_NOT_HAVE_PERMISSION_TO_GET_TASK_STATES).getUsername();
    if (mytasks) {
        userName = tmpUserName;
    }
    Page<TaskState> page = dbManager.getTaskStates(from, to, taskTag, offset, limit, userName, statusFilter, sortParams);
    for (Iterator<TaskState> it = page.getList().iterator(); it.hasNext(); ) {
        TaskState taskState = it.next();
        if (!checkJobPermissionMethod(taskState.getId().getJobId().value(), "getTaskStates")) {
            it.remove();
        }
    }
    return page;
}
Also used : TaskState(org.ow2.proactive.scheduler.common.task.TaskState) ImmediateService(org.objectweb.proactive.annotation.ImmediateService)

Aggregations

ImmediateService (org.objectweb.proactive.annotation.ImmediateService)1 TaskState (org.ow2.proactive.scheduler.common.task.TaskState)1