Search in sources :

Example 1 with ImportExternalNetworkParameters

use of org.ovirt.engine.core.common.action.ImportExternalNetworkParameters in project ovirt-engine by oVirt.

the class BaseImportNetworksModel method onImport.

public void onImport() {
    if (!validate()) {
        return;
    }
    List<ActionParametersBase> multipleActionParameters = new LinkedList<>();
    for (final ExternalNetwork externalNetwork : importedNetworks.getItems()) {
        final Network network = externalNetwork.getNetwork();
        final Guid dcId = externalNetwork.getDataCenters().getSelectedItem().getId();
        ImportExternalNetworkParameters params = new ImportExternalNetworkParameters(network.getProvidedBy().getProviderId(), network.getProvidedBy().getExternalId(), dcId, externalNetwork.isPublicUse(), true);
        multipleActionParameters.add(params);
    }
    Frontend.getInstance().runMultipleActions(ActionType.ImportExternalNetwork, multipleActionParameters, result -> sourceListModel.getSearchCommand().execute());
    cancel();
}
Also used : ImportExternalNetworkParameters(org.ovirt.engine.core.common.action.ImportExternalNetworkParameters) Network(org.ovirt.engine.core.common.businessentities.network.Network) ExternalNetwork(org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork) Guid(org.ovirt.engine.core.compat.Guid) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) LinkedList(java.util.LinkedList) ExternalNetwork(org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork)

Aggregations

LinkedList (java.util.LinkedList)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ImportExternalNetworkParameters (org.ovirt.engine.core.common.action.ImportExternalNetworkParameters)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1 Guid (org.ovirt.engine.core.compat.Guid)1 ExternalNetwork (org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork)1