use of org.ovirt.engine.core.common.businessentities.VdsSpmIdMap in project ovirt-engine by oVirt.
the class VdsSpmIdMapDaoTest method testDeleteByPoolVdsSpmIdMap.
@Test
public void testDeleteByPoolVdsSpmIdMap() {
dao.removeByVdsAndStoragePool(existingEntity.getId(), existingEntity.getStoragePoolId());
VdsSpmIdMap result = dao.get(existingEntity.getId());
assertNull(result);
}
use of org.ovirt.engine.core.common.businessentities.VdsSpmIdMap in project ovirt-engine by oVirt.
the class AddVdsSpmIdCommand method insertSpmIdToDb.
protected void insertSpmIdToDb(List<VdsSpmIdMap> vdsSpmIdMapList) {
int selectedId = 1;
List<Integer> list = vdsSpmIdMapList.stream().map(VdsSpmIdMap::getVdsSpmId).sorted().collect(Collectors.toList());
for (int id : list) {
if (selectedId == id) {
selectedId++;
} else {
break;
}
}
VdsSpmIdMap newMap = new VdsSpmIdMap(getDcId(), getVdsId(), selectedId);
vdsSpmIdMapDao.save(newMap);
if (getParameters().isCompensationEnabled()) {
getCompensationContext().snapshotNewEntity(newMap);
getCompensationContext().stateChanged();
}
}
Aggregations