protected VnicProfiles mapCollection(List<org.ovirt.engine.core.common.businessentities.network.VnicProfile> entities, Class<? extends BaseResource> suggestedParentType) { VnicProfiles collection = new VnicProfiles(); Map<Guid, Qos> qosMap = new HashMap<>(); for (org.ovirt.engine.core.common.businessentities.network.VnicProfile entity : entities) { VnicProfile profile = populate(map(entity), entity); collection.getVnicProfiles().add(profile); if (entity.getNetworkQosId() != null) { qosMap.put(entity.getNetworkQosId(), profile.getQos()); } } handleQosDataCenterLinks(qosMap); for (VnicProfile vnicProfile : collection.getVnicProfiles()) { addLinks(vnicProfile, suggestedParentType); } return collection; }
@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()); }
model.setCustomProperties(hooks); if (entity.getNetworkQosId() != null) { model.setQos(new Qos()); model.getQos().setId(entity.getNetworkQosId().toString());
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(); }