use of org.ow2.proactive.scheduler.task.TaskStateImpl in project scheduling by ow2-proactive.
the class SchedulerClient method getTaskStates.
@Override
public Page<TaskState> getTaskStates(String taskTag, long from, long to, boolean mytasks, boolean running, boolean pending, boolean finished, int offset, int limit, SortSpecifierContainer sortParams) throws NotConnectedException, PermissionException {
RestPage<TaskStateData> page = null;
SortSpecifierContainer sortContainer = new SortSpecifierContainer(sortParams.toString());
try {
page = restApi().getTaskStates(sid, from, to, mytasks, running, pending, finished, offset, limit, sortContainer);
} catch (NotConnectedRestException e) {
throw new NotConnectedException(e);
} catch (PermissionRestException e) {
throw new PermissionException(e);
}
List<TaskState> lTaskStates = new ArrayList<TaskState>(page.getList().size());
for (TaskStateData taskStateData : page.getList()) {
lTaskStates.add(new TaskStateImpl(taskStateData));
}
return new Page<TaskState>(lTaskStates, page.getSize());
}
use of org.ow2.proactive.scheduler.task.TaskStateImpl in project scheduling by ow2-proactive.
the class TaskData method toTaskState.
public TaskState toTaskState() {
TaskInfo taskInfo = toTaskInfo();
TaskStateImpl taskState = new TaskStateImpl();
taskState.update(taskInfo);
taskState.setName(getTaskName());
taskState.setDescription(getDescription());
taskState.setTag(getTag());
taskState.setIterationIndex(getIteration());
taskState.setReplicationIndex(getReplication());
taskState.setMaxNumberOfExecution(getMaxNumberOfExecution());
taskState.setParallelEnvironment(getParallelEnvironment());
taskState.setGenericInformation(getGenericInformation());
taskState.setVariables(variablesToTaskVariables());
return taskState;
}
Aggregations