use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.
the class VmInterfaceModel method selectedNetworkExternal.
protected boolean selectedNetworkExternal() {
VnicProfileView profile = getProfile().getSelectedItem();
Network network = null;
if (profile != null && profile.getId() != null) {
network = getProfileBehavior().findNetworkById(profile.getId());
}
return network != null && network.isExternal();
}
use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.
the class AddNetworkOnProviderCommand method loadPhysicalNetworkProviderParameters.
private void loadPhysicalNetworkProviderParameters() {
Network physicalProviderNetwork = networkDao.get(getNetwork().getProvidedBy().getPhysicalNetworkId());
getNetwork().setVlanId(physicalProviderNetwork.getVlanId());
getNetwork().setLabel(physicalProviderNetwork.getVdsmName());
}
use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.
the class GetExternalSubnetsOnProviderByNetworkQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
Network network = networkDao.get(getParameters().getId());
if (network == null || !network.isExternal()) {
return;
}
Provider<?> provider = providerDao.get(network.getProvidedBy().getProviderId());
if (provider == null) {
return;
}
NetworkProviderProxy client = providerProxyFactory.create(provider);
getQueryReturnValue().setReturnValue(client.getAllSubnets(network.getProvidedBy()));
}
use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.
the class PersistentHostSetupNetworksParametersFactory method create.
/**
* @param hostId host on which networks to be updated reside
* @param networks networks to be updated; it is assumed, that all those networks belongs to given host.
*
* @return PersistentHostSetupNetworksParameters to refresh all given networks.
*/
public PersistentHostSetupNetworksParameters create(Guid hostId, List<Network> networks) {
Map<Network, NetworkAttachment> networksToSync = getNetworksToSync(hostId, networks);
PersistentHostSetupNetworksParameters parameters = new PersistentHostSetupNetworksParameters(hostId);
parameters.setRollbackOnFailure(true);
parameters.setShouldBeLogged(false);
parameters.setNetworkNames(getNetworkNames(networksToSync.keySet()));
parameters.setNetworkAttachments(new ArrayList<>(networksToSync.values()));
return parameters;
}
use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.
the class RefreshNetworksParametersFactory method create.
/**
* @param networks networks to be refreshed.
* @return list of PersistentHostSetupNetworksParameters instances to update all given networks on all hosts where
* they are used.
*/
public ArrayList<ActionParametersBase> create(List<Network> networks) {
Map<Guid, List<Network>> vdsIdToNetworksOfAlteredQos = mapNetworksByAttachedHosts(networks);
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (Map.Entry<Guid, List<Network>> entry : vdsIdToNetworksOfAlteredQos.entrySet()) {
Guid hostId = entry.getKey();
List<Network> networksOfAlteredQos = entry.getValue();
PersistentHostSetupNetworksParameters setupNetworkParams = persistentHostSetupNetworksParametersFactory.create(hostId, networksOfAlteredQos);
parameters.add(setupNetworkParams);
}
return parameters;
}
Aggregations