@Override @SuppressWarnings("unchecked") public T mapRow(ResultSet rs, int rowNum) throws SQLException { T entity = createVnicProfileEntity(); entity.setId(getGuid(rs, "id")); entity.setName(rs.getString("name")); entity.setNetworkId(getGuid(rs, "network_id")); entity.setNetworkQosId(getGuid(rs, "network_qos_id")); entity.setCustomProperties(SerializationFactory.getDeserializer() .deserializeOrCreateNew(rs.getString("custom_properties"), LinkedHashMap.class)); entity.setPortMirroring(rs.getBoolean("port_mirroring")); entity.setPassthrough(rs.getBoolean("passthrough")); entity.setMigratable(rs.getBoolean("migratable")); entity.setDescription(rs.getString("description")); entity.setNetworkFilterId(getGuid(rs, "network_filter_id")); return entity; }
@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; }
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()); }
entity.setNetworkQosId(GuidUtils.asGuid(model.getQos().getId()));