use of org.ovirt.engine.api.model.DiskAttachment in project ovirt-engine by oVirt.
the class DiskAttachmentMapper method map.
@Mapping(from = org.ovirt.engine.core.common.businessentities.storage.DiskVmElement.class, to = DiskAttachment.class)
public static DiskAttachment map(org.ovirt.engine.core.common.businessentities.storage.DiskVmElement entity, DiskAttachment template) {
DiskAttachment model = template != null ? template : new DiskAttachment();
Guid vmId = entity.getVmId();
if (vmId != null) {
Vm vm = new Vm();
vm.setId(vmId.toString());
model.setVm(vm);
}
Guid diskId = entity.getDiskId();
if (diskId != null) {
Disk disk = new Disk();
disk.setId(diskId.toString());
model.setDisk(disk);
}
model.setId(entity.getDiskId().toString());
model.setBootable(entity.isBoot());
model.setPassDiscard(entity.isPassDiscard());
model.setInterface(DiskMapper.mapInterface(entity.getDiskInterface()));
model.setActive(entity.isPlugged());
model.setLogicalName(entity.getLogicalName());
model.setUsesScsiReservation(entity.isUsingScsiReservation());
model.setReadOnly(entity.isReadOnly());
return model;
}
Aggregations