use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.
the class NetworkMonitoringHelper method determineProblematicNics.
/**
* Determine which of the given NICs is problematic - a problematic NIC is considered to be a NIC which it's state
* is down and it is the underlying interface of a required network.
*
* @param interfaces
* The NICs to check.
* @param clusterNetworks
* The cluster's networks.
* @return A pair of a list of the names of the NICs which are problematic, and a list of the names of the networks
* which are required by these NICs.
*/
public static Map<String, Set<String>> determineProblematicNics(List<VdsNetworkInterface> interfaces, List<Network> clusterNetworks) {
Map<String, Set<String>> brokenNicsToNetworks = new HashMap<>();
Map<String, Network> networksByName = NetworkUtils.networksByName(clusterNetworks);
for (VdsNetworkInterface iface : interfaces) {
if (isRequiredInterfaceDown(networksByName, interfaces, iface)) {
String baseNicName = NetworkCommonUtils.stripVlan(iface);
Set<String> networks = brokenNicsToNetworks.get(baseNicName);
if (networks == null) {
networks = new HashSet<>();
brokenNicsToNetworks.put(baseNicName, networks);
}
networks.add(iface.getNetworkName());
}
}
return brokenNicsToNetworks;
}
use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.
the class ClusterListModel method onSaveInternalWithModel.
private void onSaveInternalWithModel(final ClusterModel model) {
Cluster cluster = buildCluster(model, model.getIsNew() ? new Cluster() : (Cluster) Cloner.clone(getSelectedItem()));
model.startProgress();
final Network managementNetwork = model.getManagementNetwork().getSelectedItem();
final ManagementNetworkOnClusterOperationParameters clusterOperationParameters = new ManagementNetworkOnClusterOperationParameters(cluster, managementNetwork.getId());
final ActionType actionType = model.getIsNew() ? ActionType.AddCluster : ActionType.UpdateCluster;
Frontend.getInstance().runAction(actionType, clusterOperationParameters, result -> {
ClusterListModel<Void> localModel = (ClusterListModel<Void>) result.getState();
if (model.getIsImportGlusterConfiguration().getEntity()) {
localModel.postOnSaveInternalWithImport(result.getReturnValue());
} else {
localModel.postOnSaveInternal(result.getReturnValue());
}
}, this);
}
use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.
the class ClusterNetworkListModel method setAsDisplay.
public void setAsDisplay() {
final Network network = (Network) Cloner.clone(getSelectedItem());
network.getCluster().setDisplay(true);
final NetworkClusterParameters networkClusterParameters = new NetworkClusterParameters(network.getCluster());
Frontend.getInstance().runAction(ActionType.UpdateNetworkOnCluster, networkClusterParameters);
}
use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.
the class NetworkListModel method updateDetailsAvailability.
@Override
protected void updateDetailsAvailability() {
super.updateDetailsAvailability();
NetworkView network = getSelectedItem();
if (network == null || !network.isExternal()) {
externalSubnetListModel.setIsAvailable(false);
} else {
AsyncDataProvider.getInstance().getProviderById(new AsyncQuery<>(provider -> {
boolean available = provider != null ? !provider.getIsUnmanaged() : false;
externalSubnetListModel.setIsAvailable(available);
}), network.getProvidedBy().getProviderId());
}
}
use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.
the class EditProviderModel method showConfirmation.
private void showConfirmation() {
if (providedNetworks.isEmpty()) {
actualSave();
return;
}
// $NON-NLS-1$
StringBuilder networkList = new StringBuilder("Networks:\n");
for (Network network : providedNetworks) {
// $NON-NLS-1$
networkList.append("- ").append(network.getName()).append('\n');
}
ConfirmationModel confirmationModel = new ConfirmationModel();
confirmationModel.setTitle(ConstantsManager.getInstance().getConstants().providerUrlWarningTitle());
confirmationModel.setMessage(ConstantsManager.getInstance().getMessages().providerUrlWarningText(networkList.toString()));
UICommand cmdOk = UICommand.createDefaultOkUiCommand(CMD_APPROVE, this);
confirmationModel.getCommands().add(cmdOk);
// $NON-NLS-1$
UICommand cmdCancel = UICommand.createCancelUiCommand(CMD_CANCEL, this);
confirmationModel.getCommands().add(cmdCancel);
sourceListModel.setConfirmWindow(confirmationModel);
}
Aggregations