use of org.ovirt.engine.core.common.businessentities.VmJobType in project ovirt-engine by oVirt.
the class VdsBrokerObjectsBuilder method buildVmJobData.
private static VmJob buildVmJobData(Guid vmId, Map<String, Object> struct) {
VmJob ret;
VmJobType jobType = VmJobType.getByName(assignStringValue(struct, VdsProperties.vmJobType));
if (jobType == null) {
jobType = VmJobType.UNKNOWN;
}
switch(jobType) {
case BLOCK:
VmBlockJob blockJob = new VmBlockJob();
blockJob.setBlockJobType(VmBlockJobType.getByName(assignStringValue(struct, VdsProperties.vmBlockJobType)));
blockJob.setCursorCur(assignLongValue(struct, VdsProperties.vmJobCursorCur));
blockJob.setCursorEnd(assignLongValue(struct, VdsProperties.vmJobCursorEnd));
blockJob.setBandwidth(assignLongValue(struct, VdsProperties.vmJobBandwidth));
blockJob.setImageGroupId(new Guid(assignStringValue(struct, VdsProperties.vmJobImageUUID)));
ret = blockJob;
break;
default:
ret = new VmJob();
break;
}
ret.setVmId(vmId);
ret.setId(new Guid(assignStringValue(struct, VdsProperties.vmJobId)));
ret.setJobState(VmJobState.NORMAL);
ret.setJobType(jobType);
return ret;
}
Aggregations