use of org.ovirt.engine.core.common.businessentities.network.VnicProfile in project ovirt-engine by oVirt.
the class NetworkCommon method removeVnicProfiles.
protected void removeVnicProfiles() {
List<VnicProfile> profiles = vnicProfileDao.getAllForNetwork(getNetwork().getId());
for (VnicProfile vnicProfile : profiles) {
getCompensationContext().snapshotEntity(vnicProfile);
vnicProfileDao.remove(vnicProfile.getId());
}
}
use of org.ovirt.engine.core.common.businessentities.network.VnicProfile in project ovirt-engine by oVirt.
the class NetworkCommon method updateDefaultVnicProfileName.
protected void updateDefaultVnicProfileName(String oldVnicProfileName) {
Optional<VnicProfile> defaultVnicProfileOption = vnicProfileDao.getAllForNetwork(getNetwork().getId()).stream().filter(profile -> profile.getName().equals(oldVnicProfileName)).findFirst();
if (defaultVnicProfileOption.isPresent()) {
VnicProfile defaultVnicProfile = defaultVnicProfileOption.get();
defaultVnicProfile.setName(getNetworkName());
vnicProfileDao.update(defaultVnicProfile);
}
}
use of org.ovirt.engine.core.common.businessentities.network.VnicProfile in project ovirt-engine by oVirt.
the class VnicProfileDaoTest method testGetWithPassthrough.
/**
* Ensures that the network interface profile is returned.
*/
@Test
public void testGetWithPassthrough() {
VnicProfile result = dao.get(FixturesTool.VM_NETWORK_INTERFACE_PASSTHROUGH_PROFILE);
assertNotNull(result);
assertEquals(FixturesTool.VM_NETWORK_INTERFACE_PASSTHROUGH_PROFILE, result.getId());
assertTrue(result.isPassthrough());
assertFalse(result.isMigratable());
}
use of org.ovirt.engine.core.common.businessentities.network.VnicProfile in project ovirt-engine by oVirt.
the class VnicProfileDaoTest method generateNewEntity.
@Override
protected VnicProfile generateNewEntity() {
VnicProfile vnicProfile = new VnicProfile();
vnicProfile.setId(Guid.newGuid());
vnicProfile.setName("new_profile");
vnicProfile.setNetworkId(FixturesTool.NETWORK_ENGINE);
vnicProfile.setNetworkQosId(FixturesTool.NETWORK_QOS);
vnicProfile.setPortMirroring(false);
vnicProfile.setPassthrough(false);
vnicProfile.setNetworkFilterId(FixturesTool.VNIC_PROFILE_NETWORK_FILTER);
vnicProfile.setMigratable(true);
vnicProfile.setCustomProperties(Collections.emptyMap());
return vnicProfile;
}
use of org.ovirt.engine.core.common.businessentities.network.VnicProfile in project ovirt-engine by oVirt.
the class VnicProfileDaoTest method testGetWithPm.
/**
* Ensures that the network interface profile is returned.
*/
@Test
public void testGetWithPm() {
VnicProfile result = dao.get(FixturesTool.VM_NETWORK_INTERFACE_PM_PROFILE);
assertNotNull(result);
assertEquals(FixturesTool.VM_NETWORK_INTERFACE_PM_PROFILE, result.getId());
assertTrue(result.isPortMirroring());
}
Aggregations