use of org.ovirt.engine.core.common.businessentities.network.NetworkView 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.NetworkView in project ovirt-engine by oVirt.
the class NetworkProfileListModel method updateActionAvailability.
private void updateActionAvailability() {
NetworkView network = getEntity();
getNewCommand().setIsExecutionAllowed(network != null && network.isVmNetwork());
getEditCommand().setIsExecutionAllowed(getSelectedItems() != null && getSelectedItems().size() == 1);
getRemoveCommand().setIsExecutionAllowed(getSelectedItems() != null && getSelectedItems().size() > 0);
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkView in project ovirt-engine by oVirt.
the class NetworkViewDaoTest method testGetAllForProvider.
/**
* Ensures the right set of networks are returned for the given provider.
*/
@Test
public void testGetAllForProvider() {
List<NetworkView> result = dao.getAllForProvider(FixturesTool.PROVIDER_ID);
assertNotNull(result);
assertFalse(result.isEmpty());
for (NetworkView network : result) {
assertEquals(FixturesTool.PROVIDER_ID, network.getProvidedBy().getProviderId());
assertEquals(FixturesTool.PROVIDER_NAME, network.getProviderName());
}
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkView in project ovirt-engine by oVirt.
the class NetworkExternalSubnetListModel method adjustActionButtonsForNetworkReadOnlyProperty.
private void adjustActionButtonsForNetworkReadOnlyProperty() {
NetworkView networkView = getEntity();
if (!networkView.isExternal()) {
setCommandExecutionAllowed(true);
return;
}
Guid providerGuid = networkView.getProvidedBy().getProviderId();
Frontend.getInstance().runQuery(QueryType.GetProviderById, new IdQueryParameters(providerGuid), createProviderReadOnlyCallback());
}
Aggregations