entity.setSize(rs.getLong("size")); entity.setParentId(getGuidDefaultEmpty(rs, "ParentId")); entity.setImageStatus(ImageStatus.forValue(rs .getInt("imageStatus"))); entity.setLastModified(DbFacadeUtils.fromDate(rs
protected org.ovirt.engine.core.common.businessentities.storage.Disk getEntity(int index, boolean noSD) { DiskImage entity = new DiskImage(); entity.setId(GUIDS[index]); entity.setVolumeFormat(VolumeFormat.RAW); entity.setImageStatus(ImageStatus.OK); entity.setVolumeType(VolumeType.Sparse); entity.setShareable(false); entity.setPropagateErrors(PropagateErrors.On); ArrayList<Guid> storages = new ArrayList<>(); if (!noSD) { storages.addAll(Arrays.asList(GUIDS)); } entity.setStorageIds(storages); return setUpStatisticalEntityExpectations(entity); } static org.ovirt.engine.core.common.businessentities.storage.Disk setUpStatisticalEntityExpectations(DiskImage entity) {
@Override protected org.ovirt.engine.core.common.businessentities.storage.Disk getEntity(int index) { DiskImage entity = new DiskImage(); entity.setId(GUIDS[index]); entity.setImageId(GUIDS[1]); entity.setVolumeFormat(VolumeFormat.RAW); entity.setImageStatus(ImageStatus.OK); entity.setVolumeType(VolumeType.Sparse); entity.setShareable(false); entity.setPropagateErrors(PropagateErrors.On); ArrayList<Guid> sdIds = new ArrayList<>(); sdIds.add(Guid.Empty); entity.setStorageIds(sdIds); return setUpStatisticalEntityExpectations(entity); }
di.setImageTemplateId(diskImage.getImageTemplateId()); di.setParentId(diskImage.getParentId()); di.setImageStatus(diskImage.getImageStatus()); if (diskImage.getLastModified() != null) { di.setLastModified(new Date(diskImage.getLastModified().getTime())); di.setLastModified(new Date()); di.setActive(true); di.setImageStatus(ImageStatus.LOCKED); return di;
@Override protected org.ovirt.engine.core.common.businessentities.storage.Disk getEntity(int index) { DiskImage entity = new DiskImage(); entity.setId(GUIDS[index]); entity.setVolumeFormat(VolumeFormat.RAW); entity.setImageStatus(ImageStatus.OK); entity.setVolumeType(VolumeType.Sparse); entity.setShareable(false); entity.setPropagateErrors(PropagateErrors.On); return setUpStatisticalEntityExpectations(entity); }
@Override protected org.ovirt.engine.core.common.businessentities.storage.Disk getEntity(int index) { DiskImage entity = new DiskImage(); entity.setId(GUIDS[index]); entity.setVolumeFormat(VolumeFormat.RAW); entity.setImageStatus(ImageStatus.OK); entity.setVolumeType(VolumeType.Sparse); entity.setShareable(false); entity.setPropagateErrors(PropagateErrors.On); return setUpStatisticalEntityExpectations(entity); }
@Override protected org.ovirt.engine.core.common.businessentities.storage.Disk getEntity(int index) { DiskImage entity = new DiskImage(); entity.setId(GUIDS[index]); entity.setVolumeFormat(VolumeFormat.RAW); entity.setImageStatus(ImageStatus.OK); entity.setVolumeType(VolumeType.Sparse); entity.setShareable(false); entity.setPropagateErrors(PropagateErrors.On); return setUpStatisticalEntityExpectations(entity); }
image.setImageStatus(ImageStatus.OK);
diskImage.setImageStatus(mapDiskStatus(disk.getStatus()));