use of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface in project ovirt-engine by oVirt.
the class MatchUserMappingToOvfVnicTest method testFindMappingEntryEmptyInput.
@Test
public void testFindMappingEntryEmptyInput() {
VmNetworkInterface vnic = new VmNetworkInterface();
MapVnicsContext ctx = new MapVnicsContext();
ctx.setUserMappings(emptyList());
ctx.setOvfVnics(singletonList(vnic));
underTest.handle(ctx);
assertEquals(1, ctx.getMatched().size());
assertEquals(null, ctx.getMatched().get(vnic));
}
use of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface in project ovirt-engine by oVirt.
the class MapVnicFlowTestUtils method vnicOf.
static VmNetworkInterface vnicOf(Guid profileId, String profileName, String networkName) {
VmNetworkInterface vnic = vnicOf(profileName, networkName);
vnic.setVnicProfileId(profileId);
return vnic;
}
use of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface in project ovirt-engine by oVirt.
the class MapVnicFlowTestUtils method vnicOf.
static VmNetworkInterface vnicOf(String profileName, String networkName) {
VmNetworkInterface vnic = new VmNetworkInterface();
vnic.setVnicProfileName(profileName);
vnic.setNetworkName(networkName);
return vnic;
}
use of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface in project ovirt-engine by oVirt.
the class ResourceManager method storeVm.
private void storeVm(VM vm) {
vmDynamicDao.update(vm.getDynamicData());
getVmManager(vm.getId()).update(vm.getStatisticsData());
List<VmNetworkInterface> interfaces = vm.getInterfaces();
if (interfaces != null) {
for (VmNetworkInterface ifc : interfaces) {
VmNetworkStatistics stats = ifc.getStatistics();
vmNetworkStatisticsDao.update(stats);
}
}
}
use of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface in project ovirt-engine by oVirt.
the class NicActivateStatusColumn method getTooltip.
@Override
public SafeHtml getTooltip(T object) {
VmNetworkInterface vnic = null;
if (object instanceof VmNetworkInterface) {
vnic = (VmNetworkInterface) object;
} else if (object instanceof PairQueryable && ((PairQueryable) object).getFirst() instanceof VmNetworkInterface) {
vnic = ((PairQueryable<VmNetworkInterface, VM>) object).getFirst();
}
// $NON-NLS-1$
StringBuilder tooltip = new StringBuilder("");
boolean vnicExist = vnic != null;
if (vnicExist && vnic.isPlugged()) {
tooltip = tooltip.append(templates.cardStatus(constants.pluggedNetworkInterface()).asString());
} else {
tooltip = tooltip.append(templates.cardStatus(constants.unpluggedNetworkInterface()).asString());
}
// $NON-NLS-1$
tooltip = tooltip.append("<BR>");
if (vnicExist && vnic.isLinked()) {
tooltip = tooltip.append(templates.linkState(constants.linkedNetworkInterface()).asString());
} else {
tooltip = tooltip.append(templates.linkState(constants.unlinkedNetworkInterface()).asString());
}
return SafeHtmlUtils.fromTrustedString(tooltip.toString());
}
Aggregations