use of org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobType in project ovirt-engine by oVirt.
the class GetHostJobsVDSCommand method parseJob.
private HostJobInfo parseJob(Map<String, Object> job) {
Guid id = Guid.createGuidFromString((String) job.get(VdsProperties.jobId));
HostJobType type = HostJobType.valueOf((String) job.get(VdsProperties.jobType));
HostJobStatus status = HostJobStatus.valueOf((String) job.get(VdsProperties.jobStatus));
String description = (String) job.get(VdsProperties.jobDescription);
Integer jobProgress = job.containsKey(VdsProperties.jobProgress) ? ((Double) job.get(VdsProperties.jobProgress)).intValue() : null;
VDSError error = null;
if (job.containsKey(VdsProperties.jobError)) {
Map<String, Object> errorInfo = (Map<String, Object>) job.get(VdsProperties.jobError);
Integer code = (Integer) errorInfo.get(VdsProperties.jobErrorCode);
String message = (String) errorInfo.get(VdsProperties.jobErrorMessage);
error = new VDSError(EngineError.forValue(code), message);
}
return new HostJobInfo(id, description, type, status, jobProgress, error);
}
Aggregations