Search in sources :

Example 1 with NewVnicProfileModel

use of org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel in project ovirt-engine by oVirt.

the class NetworkProfileListModel method newProfile.

public void newProfile() {
    if (getWindow() != null) {
        return;
    }
    NewVnicProfileModel model = new NewVnicProfileModel(this, getEntity().getDataCenterId());
    setWindow(model);
    VnicProfile profile = new VnicProfile();
    profile.setNetworkId(getEntity().getId());
    model.setProfile(profile);
}
Also used : VnicProfile(org.ovirt.engine.core.common.businessentities.network.VnicProfile) NewVnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel)

Example 2 with NewVnicProfileModel

use of org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel in project ovirt-engine by oVirt.

the class NetworkModel method createDefaultProfile.

private VnicProfileModel createDefaultProfile() {
    final VnicProfileModel defaultProfile = new NewVnicProfileModel();
    // make sure default profile's name is in sync with network's name
    defaultProfile.getName().setEntity(getName().getEntity());
    final IEventListener<EventArgs> networkNameListener = (ev, sender, args) -> defaultProfile.getName().setEntity(getName().getEntity());
    getName().getEntityChangedEvent().addListener(networkNameListener);
    // if user overrides default name, stop tracking network's name
    defaultProfile.getName().getEntityChangedEvent().addListener(new IEventListener<EventArgs>() {

        @Override
        public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) {
            String defaultProfileName = defaultProfile.getName().getEntity();
            if ((defaultProfileName != null) && (!defaultProfileName.equals(getName().getEntity()))) {
                getName().getEntityChangedEvent().removeListener(networkNameListener);
                defaultProfile.getName().getEntityChangedEvent().removeListener(this);
            }
        }
    });
    return defaultProfile;
}
Also used : ExternalSubnetModel(org.ovirt.engine.ui.uicommonweb.models.providers.ExternalSubnetModel) Arrays(java.util.Arrays) DnsResolverConfiguration(org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration) RegexValidation(org.ovirt.engine.ui.uicommonweb.validation.RegexValidation) SpecialAsciiI18NOrNoneValidation(org.ovirt.engine.ui.uicommonweb.validation.SpecialAsciiI18NOrNoneValidation) Provider(org.ovirt.engine.core.common.businessentities.Provider) Event(org.ovirt.engine.ui.uicompat.Event) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) SearchableListModel(org.ovirt.engine.ui.uicommonweb.models.SearchableListModel) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ActionType(org.ovirt.engine.core.common.action.ActionType) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) EventArgs(org.ovirt.engine.ui.uicompat.EventArgs) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) OpenstackNetworkProviderProperties(org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties) IntegerValidation(org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) DnsConfigurationModel(org.ovirt.engine.ui.uicommonweb.models.dnsconfiguration.DnsConfigurationModel) NameServer(org.ovirt.engine.core.common.businessentities.network.NameServer) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) HasValidatedTabs(org.ovirt.engine.ui.uicommonweb.models.HasValidatedTabs) BusinessEntitiesDefinitions(org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions) StringHelper(org.ovirt.engine.core.compat.StringHelper) Collectors(java.util.stream.Collectors) ApplicationModeHelper(org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper) List(java.util.List) ValidationCompleteEvent(org.ovirt.engine.ui.uicommonweb.models.ValidationCompleteEvent) NewVnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) NewHostNetworkQosModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.NewHostNetworkQosModel) Guid(org.ovirt.engine.core.compat.Guid) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback) IEventListener(org.ovirt.engine.ui.uicompat.IEventListener) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ArrayList(java.util.ArrayList) Frontend(org.ovirt.engine.ui.frontend.Frontend) NetworkProfilesModel(org.ovirt.engine.ui.uicommonweb.models.profiles.NetworkProfilesModel) AddVnicProfileParameters(org.ovirt.engine.core.common.action.AddVnicProfileParameters) Network(org.ovirt.engine.core.common.businessentities.network.Network) LinkedList(java.util.LinkedList) HostNetworkQos(org.ovirt.engine.core.common.businessentities.network.HostNetworkQos) Model(org.ovirt.engine.ui.uicommonweb.models.Model) Linq(org.ovirt.engine.ui.uicommonweb.Linq) VnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel) IValidation(org.ovirt.engine.ui.uicommonweb.validation.IValidation) VnicProfile(org.ovirt.engine.core.common.businessentities.network.VnicProfile) ConfigValues(org.ovirt.engine.core.common.config.ConfigValues) TabName(org.ovirt.engine.ui.uicommonweb.models.TabName) AsciiNameValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) NewVnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel) NewVnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel) VnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel) EventArgs(org.ovirt.engine.ui.uicompat.EventArgs) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs)

Example 3 with NewVnicProfileModel

use of org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel in project ovirt-engine by oVirt.

the class VnicProfilesEditor method createGhostValue.

@Override
protected VnicProfileModel createGhostValue() {
    VnicProfileModel profile = new NewVnicProfileModel();
    profile.initNetworkQoSList(dcId);
    return profile;
}
Also used : NewVnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel) NewVnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel) VnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel)

Aggregations

NewVnicProfileModel (org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel)3 VnicProfile (org.ovirt.engine.core.common.businessentities.network.VnicProfile)2 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ActionType (org.ovirt.engine.core.common.action.ActionType)1 AddVnicProfileParameters (org.ovirt.engine.core.common.action.AddVnicProfileParameters)1 BusinessEntitiesDefinitions (org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions)1 OpenstackNetworkProviderProperties (org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties)1 Provider (org.ovirt.engine.core.common.businessentities.Provider)1 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)1 DnsResolverConfiguration (org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration)1 HostNetworkQos (org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)1 NameServer (org.ovirt.engine.core.common.businessentities.network.NameServer)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1 ConfigValues (org.ovirt.engine.core.common.config.ConfigValues)1 ApplicationMode (org.ovirt.engine.core.common.mode.ApplicationMode)1