use of org.ovirt.engine.core.bll.tasks.interfaces.CommandCoordinator in project ovirt-engine by oVirt.
the class AsyncTaskFactory method construct.
/**
* Constructs a task based on creation info (task type and task parameters
* as retrieved from the vdsm). Use in order to construct tasks when service
* is initializing.
* @param creationInfo
* The Asyc Task Creation info
*/
public SPMAsyncTask construct(AsyncTaskCreationInfo creationInfo) {
CommandCoordinator coco = cocoInstance.get();
AsyncTask asyncTask = coco.getByVdsmTaskId(creationInfo.getVdsmTaskId());
if (asyncTask == null || asyncTask.getActionParameters() == null) {
asyncTask = new AsyncTask(AsyncTaskResultEnum.success, AsyncTaskStatusEnum.running, Guid.Empty, creationInfo.getVdsmTaskId(), creationInfo.getStepId(), creationInfo.getStoragePoolID(), creationInfo.getTaskType(), getCommandEntity(coco, asyncTask == null ? Guid.newGuid() : asyncTask.getRootCommandId()), getCommandEntity(coco, asyncTask == null ? Guid.newGuid() : asyncTask.getCommandId()));
creationInfo.setTaskType(AsyncTaskType.unknown);
}
AsyncTaskParameters asyncTaskParams = new AsyncTaskParameters(creationInfo, asyncTask);
return construct(creationInfo.getTaskType(), asyncTaskParams, true);
}
Aggregations