use of org.ovirt.engine.core.common.businessentities.AsyncTaskStatus in project ovirt-engine by oVirt.
the class SPMAsyncTask method checkTaskExist.
/**
* Print log message, Checks if the cachedStatusTask is null, (indicating the task was not found in the SPM).
* If so returns {@link AsyncTaskStatusEnum#unknown} status, otherwise returns the status as given.<br>
* <br>
* @param cachedStatusTask The status from the SPM, or <code>null</code> is the task wasn't found in the SPM.
* @return - Updated status task
*/
protected AsyncTaskStatus checkTaskExist(AsyncTaskStatus cachedStatusTask) {
AsyncTaskStatus returnedStatusTask = null;
// If the cachedStatusTask is null ,that means the task has not been found in the SPM.
if (cachedStatusTask == null) {
// Set to running in order to continue polling the task in case SPM hasn't loaded the tasks yet..
returnedStatusTask = new AsyncTaskStatus(AsyncTaskStatusEnum.unknown);
log.error("SPMAsyncTask::PollTask: Task '{}' (Parent Command '{}', Parameters Type '{}') " + "was not found in VDSM, will change its status to unknown.", getVdsmTaskId(), getParameters().getDbAsyncTask().getActionType(), getParameters().getClass().getName());
} else {
returnedStatusTask = cachedStatusTask;
}
return returnedStatusTask;
}
Aggregations