@Override public VmNetworkInterface mapRow(ResultSet rs, int rowNum) throws SQLException { VmNetworkInterface entity = super.mapRow(rs, rowNum); entity.setStatistics(VmNetworkStatisticsRowMapper.INSTANCE.mapRow(rs, rowNum)); entity.setNetworkName(rs.getString("network_name")); entity.setVmName(rs.getString("vm_name")); entity.setVnicProfileName(rs.getString("vnic_profile_name")); entity.setPlugged(rs.getBoolean("is_plugged")); entity.setPortMirroring(rs.getBoolean("port_mirroring")); entity.setQosName(rs.getString("qos_name")); return entity; }
@Override public VmNetworkInterface mapRow(ResultSet rs, int rowNum) throws SQLException { VmNetworkInterface entity = new VmNetworkInterface(); entity.setId(getGuidDefaultEmpty(rs, "id")); entity.setVmId(getGuid(rs, "vm_guid")); entity.setMacAddress(rs.getString("mac_addr")); entity.setSpeed(rs.getInt("speed")); entity.setStatistics(VmNetworkStatisticsRowMapper.INSTANCE.mapRow(rs, rowNum)); return entity; }
public VmNetworkInterface(VmNetworkInterface iface) { setId(iface.getId()); setMacAddress(iface.getMacAddress()); setName(iface.getName()); setNetworkName(iface.getNetworkName()); setLinked(iface.isLinked()); setSpeed(iface.getSpeed()); setType(iface.getType()); setVmId(iface.getVmId()); setVmName(iface.getVmName()); setVmTemplateId(iface.getVmTemplateId()); setStatistics(new VmNetworkStatistics(iface.getStatistics())); }
@BeforeEach @Override public void setUp() throws Exception { super.setUp(); existingVmInterface = dao.get(FixturesTool.VM_NETWORK_INTERFACE); existingTemplateInterface = dao.get(FixturesTool.TEMPLATE_NETWORK_INTERFACE); newVmInterface = new VmNetworkInterface(); newVmInterface.setStatistics(new VmNetworkStatistics()); newVmInterface.setId(Guid.newGuid()); newVmInterface.setVnicProfileId(FixturesTool.VM_NETWORK_INTERFACE_PROFILE); newVmInterface.setName("eth77"); newVmInterface.setNetworkName("enginet"); newVmInterface.setLinked(true); newVmInterface.setSpeed(1000); newVmInterface.setType(3); newVmInterface.setMacAddress("01:C0:81:21:71:17"); newVmDevice.setType(VmDeviceGeneralType.INTERFACE); newVmDevice.setDevice("bridge"); newVmDevice.setAddress("sample"); newVmDevice.setManaged(true); newVmDevice.setPlugged(true); newVmDevice.setReadOnly(false); Map<String, String> customProp = new LinkedHashMap<>(); customProp.put("prop1", "val1"); newVmDevice.setCustomProperties(customProp); }