use of org.ovirt.engine.core.common.businessentities.V2VJobInfo in project ovirt-engine by oVirt.
the class VdsBrokerObjectsBuilder method buildV2VJobData.
private static V2VJobInfo buildV2VJobData(String jobId, Map<String, Object> struct) {
V2VJobInfo job = new V2VJobInfo();
job.setId(Guid.createGuidFromString(jobId));
job.setStatus(getV2VJobStatusValue(struct));
job.setDescription(assignStringValue(struct, VdsProperties.v2vDescription));
job.setProgress(assignIntValue(struct, VdsProperties.v2vProgress));
return job;
}
use of org.ovirt.engine.core.common.businessentities.V2VJobInfo in project ovirt-engine by oVirt.
the class ConvertVmCallback method doPolling.
@Override
public void doPolling(Guid cmdId, List<Guid> childCmdIds) {
V2VJobInfo jobInfo = getV2VJobInfo();
switch(jobInfo.getStatus()) {
case STARTING:
case COPYING_DISK:
updateProgress(jobInfo);
break;
case DONE:
updateProgress("Finalizing", 100);
getCommand().setCommandStatus(CommandStatus.SUCCEEDED);
break;
case NOT_EXIST:
jobInfo.setDescription(JOB_DOES_NOT_EXIST_MSG);
case ERROR:
log.info("Conversion of VM from external environment failed: {}", jobInfo.getDescription());
case ABORTED:
updateProgress("Canceling", 0);
getCommand().setCommandStatus(CommandStatus.FAILED);
break;
case UNKNOWN:
case WAIT_FOR_START:
default:
}
}
Aggregations