Search in sources :

Example 1 with CommandAsyncTask

use of org.ovirt.engine.core.bll.tasks.CommandAsyncTask in project ovirt-engine by oVirt.

the class CommandMultiAsyncTasks method getEndedTasksInfo.

public EndedTasksInfo getEndedTasksInfo() {
    EndedTasksInfo endedTasksInfo = new EndedTasksInfo();
    ArrayList<EndedTaskInfo> endedTaskInfoList = new ArrayList<>();
    synchronized (_listTasks) {
        ArrayList<CommandAsyncTask> CurrentActionTypeTasks = getCurrentTasks();
        for (CommandAsyncTask task : CurrentActionTypeTasks) {
            task.setLastStatusAccessTime();
            EndedTaskInfo tempVar = new EndedTaskInfo();
            tempVar.setTaskStatus(task.getLastTaskStatus());
            tempVar.setTaskParameters(task.getParameters());
            endedTaskInfoList.add(tempVar);
        }
        endedTasksInfo.setTasksInfo(endedTaskInfoList);
    }
    return endedTasksInfo;
}
Also used : CommandAsyncTask(org.ovirt.engine.core.bll.tasks.CommandAsyncTask) EndedTasksInfo(org.ovirt.engine.core.common.asynctasks.EndedTasksInfo) ArrayList(java.util.ArrayList) EndedTaskInfo(org.ovirt.engine.core.common.asynctasks.EndedTaskInfo)

Example 2 with CommandAsyncTask

use of org.ovirt.engine.core.bll.tasks.CommandAsyncTask in project ovirt-engine by oVirt.

the class CommandMultiAsyncTasks method clearTasks.

public void clearTasks() {
    synchronized (_listTasks) {
        ArrayList<CommandAsyncTask> CurrentActionTypeTasks = getCurrentTasks();
        for (CommandAsyncTask task : CurrentActionTypeTasks) {
            if (task.getLastTaskStatus().getStatus() == AsyncTaskStatusEnum.finished) {
                task.clearAsyncTask();
                _listTasks.remove(task.getVdsmTaskId());
            }
        }
    }
}
Also used : CommandAsyncTask(org.ovirt.engine.core.bll.tasks.CommandAsyncTask)

Aggregations

CommandAsyncTask (org.ovirt.engine.core.bll.tasks.CommandAsyncTask)2 ArrayList (java.util.ArrayList)1 EndedTaskInfo (org.ovirt.engine.core.common.asynctasks.EndedTaskInfo)1 EndedTasksInfo (org.ovirt.engine.core.common.asynctasks.EndedTasksInfo)1