Search in sources :

Example 1 with AsyncTaskType

use of org.ovirt.engine.core.common.asynctasks.AsyncTaskType in project ovirt-engine by oVirt.

the class HSMGetAllTasksInfoVDSCommand method parseTaskInfo.

protected AsyncTaskCreationInfo parseTaskInfo(Map<String, String> taskInfo, Guid taskID) {
    try {
        String deTaskType = taskInfo.get(VERB_KEY);
        AsyncTaskType taskType;
        try {
            taskType = AsyncTaskType.valueOf(deTaskType);
        } catch (Exception e) {
            taskType = AsyncTaskType.unknown;
            log.warn("The task type in the vdsm response is '{}' and does not " + " appear in the AsyncTaskType enum", deTaskType);
        }
        AsyncTaskCreationInfo tempVar = new AsyncTaskCreationInfo();
        tempVar.setVdsmTaskId(taskID);
        tempVar.setTaskType(taskType);
        AsyncTaskCreationInfo task = tempVar;
        return task;
    } catch (RuntimeException e) {
        log.error("Could not parse single task info: '{}' (possibly specific task should not be monitored): {}", taskInfo, e.getMessage());
        log.debug("Exception", e);
        return null;
    }
}
Also used : AsyncTaskType(org.ovirt.engine.core.common.asynctasks.AsyncTaskType) AsyncTaskCreationInfo(org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo)

Aggregations

AsyncTaskCreationInfo (org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo)1 AsyncTaskType (org.ovirt.engine.core.common.asynctasks.AsyncTaskType)1