public EditVnicProfileModel(SearchableListModel<?, ?> sourceModel, VnicProfile profile, Guid dcId, boolean customPropertiesVisible) { super(sourceModel, customPropertiesVisible, dcId, profile.getNetworkQosId()); setTitle(constants.vnicProfileTitle()); setHelpTag(HelpTag.edit_vnic_profile); setHashName("edit_vnic_profile"); //$NON-NLS-1$ setProfile(profile); getName().setEntity(profile.getName()); getDescription().setEntity(profile.getDescription()); getPassthrough().setEntity(getProfile().isPassthrough()); getMigratable().setEntity(!getProfile().isPassthrough() || getProfile().isMigratable()); getPortMirroring().setEntity(getProfile().isPortMirroring()); getPublicUse().setIsAvailable(false); updateChangabilityIfVmsUsingTheProfile(); }
/** * 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()); }
@Override public String toString() { return ToStringBuilder.forInstance(this) .append("id", getId()) .append("networkId", getNetworkId()) .append("networkQosId", getNetworkQosId()) .append("portMirroring", isPortMirroring()) .append("passthrough", isPassthrough()) .append("migratable", isMigratable()) .append("customProperties", getCustomProperties()) .append("description", getDescription()) .append("networkFilterId", getNetworkFilterId()) .build(); } }
@Override protected MapSqlParameterSource createFullParametersMapper(VnicProfile profile) { return createIdParameterMapper(profile.getId()) .addValue("name", profile.getName()) .addValue("network_id", profile.getNetworkId()) .addValue("network_qos_id", profile.getNetworkQosId()) .addValue("port_mirroring", profile.isPortMirroring()) .addValue("passthrough", profile.isPassthrough()) .addValue("migratable", profile.isMigratable()) .addValue("description", profile.getDescription()) .addValue("custom_properties", SerializationFactory.getSerializer().serialize(profile.getCustomProperties())) .addValue("network_filter_id", profile.getNetworkFilterId()); }
vnicPassThrough.setMode(map(entity.isPassthrough())); model.setPassThrough(vnicPassThrough); if (entity.getNetworkFilterId() != null){ if (entity.isPassthrough()) { model.setMigratable(entity.isMigratable());
public void flush() { if (vnicProfile == null) { vnicProfile = new VnicProfile(); } vnicProfile.setName(getName().getEntity()); Network network = getNetwork().getSelectedItem(); vnicProfile.setNetworkId(network != null ? network.getId() : null); NetworkQoS networkQoS = getNetworkQoS().getSelectedItem(); vnicProfile.setNetworkQosId(networkQoS != null && networkQoS.getId() != null && !networkQoS.getId().equals(Guid.Empty) ? networkQoS.getId() : null); NetworkFilter networkFilter = getNetworkFilter().getSelectedItem(); vnicProfile.setNetworkFilterId(networkFilter != null ? networkFilter.getId() : null); vnicProfile.setPortMirroring(getPortMirroring().getEntity()); vnicProfile.setPassthrough(getPassthrough().getEntity()); if (vnicProfile.isPassthrough()) { vnicProfile.setMigratable(getMigratable().getEntity()); } if (customPropertiesVisible) { vnicProfile.setCustomProperties(KeyValueModel.convertProperties(getCustomPropertySheet().serialize())); } else { vnicProfile.setCustomProperties(null); } vnicProfile.setDescription(getDescription().getEntity()); }
if (entity.isPassthrough() && model.isSetMigratable()) { entity.setMigratable(model.isMigratable());