Search in sources :

Example 51 with Network

use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.

the class HostNetworkAttachmentsPersister method initReportedNetworksAndNics.

private void initReportedNetworksAndNics(List<VdsNetworkInterface> nics) {
    for (VdsNetworkInterface nic : nics) {
        if (nic.getNetworkName() != null) {
            Network network = clusterNetworks.get(nic.getNetworkName());
            if (network != null) {
                reportedNetworksById.put(network.getId(), network);
                reportedNicsByNetworkId.put(network.getId(), nic);
            }
        }
    }
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)

Example 52 with Network

use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.

the class HostNetworkAttachmentsPersisterTest method createNetworkWithName.

private Network createNetworkWithName(String networkName) {
    Network network = new Network();
    network.setName(networkName);
    network.setId(Guid.newGuid());
    return network;
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network)

Example 53 with Network

use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.

the class DataCenterNetworkListModel method edit.

public void edit() {
    final Network network = getSelectedItem();
    if (getWindow() != null) {
        return;
    }
    final NetworkModel networkModel = new EditNetworkModel(network, this);
    setWindow(networkModel);
    networkModel.getDataCenters().setItems(Arrays.asList(getEntity()));
    networkModel.getDataCenters().setSelectedItem(getEntity());
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network)

Example 54 with Network

use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.

the class RemoveNetworksModel method onRemove.

public void onRemove() {
    ArrayList<ActionParametersBase> pb = new ArrayList<>();
    for (Object a : sourceListModel.getSelectedItems()) {
        Network network = (Network) a;
        if (network.isExternal()) {
            pb.add(new RemoveNetworkParameters(network.getId(), getForce().getEntity()));
        } else {
            pb.add(new RemoveNetworkParameters(network.getId()));
        }
    }
    Frontend.getInstance().runMultipleAction(ActionType.RemoveNetwork, pb);
    sourceListModel.setConfirmWindow(null);
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) ArrayList(java.util.ArrayList) RemoveNetworkParameters(org.ovirt.engine.core.common.action.RemoveNetworkParameters) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 55 with Network

use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.

the class ExecuteNetworkCommandInNetworkOperationTest method createNetwork.

private Network createNetwork(String networkA) {
    Network result = new Network();
    result.setId(Guid.newGuid());
    result.setName(networkA);
    return result;
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network)

Aggregations

Network (org.ovirt.engine.core.common.businessentities.network.Network)292 Test (org.junit.Test)105 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)63 FindActiveVmsUsingNetwork (org.ovirt.engine.core.bll.network.FindActiveVmsUsingNetwork)47 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)46 ArrayList (java.util.ArrayList)44 Guid (org.ovirt.engine.core.compat.Guid)44 ProviderNetwork (org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)39 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)23 List (java.util.List)21 EngineMessage (org.ovirt.engine.core.common.errors.EngineMessage)21 HashMap (java.util.HashMap)19 NetworkCluster (org.ovirt.engine.core.common.businessentities.network.NetworkCluster)19 Map (java.util.Map)13 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)13 VnicProfile (org.ovirt.engine.core.common.businessentities.network.VnicProfile)13 HashSet (java.util.HashSet)9 Set (java.util.Set)9 BusinessEntityMap (org.ovirt.engine.core.common.businessentities.BusinessEntityMap)9 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)9