use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.
the class ProfileBehavior method initProfiles.
public void initProfiles(final Guid clusterId, final Guid dcId, final AsyncQuery<List<VnicProfileView>> profilesQuery) {
AsyncQuery<QueryReturnValue> networksQuery = new AsyncQuery<>(response -> {
clusterNetworks = response.getReturnValue();
managementNetworkName = clusterNetworks.stream().filter(n -> n.getCluster().isManagement()).map(Network::getName).findFirst().orElse(null);
profilesQuery.converterCallback = returnValue -> {
List<VnicProfileView> vnicProfiles = new ArrayList<>();
vnicProfiles.add(VnicProfileView.EMPTY);
if (returnValue == null) {
return vnicProfiles;
}
for (VnicProfileView vnicProfile : (List<VnicProfileView>) returnValue) {
Network network = findNetworkById(vnicProfile.getNetworkId());
if (network != null) {
vnicProfiles.add(vnicProfile);
}
}
Collections.sort(vnicProfiles, Linq.VnicProfileViewComparator);
return vnicProfiles;
};
AsyncDataProvider.getInstance().getVnicProfilesByDcId(profilesQuery, dcId);
});
Frontend.getInstance().runQuery(QueryType.GetAllVmNetworksByClusterId, new IdQueryParameters(clusterId), networksQuery);
}
use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.
the class ImportNetworkData method setSelectedNetworkName.
public void setSelectedNetworkName(String networkName) {
selectedNetworkName = networkName;
filteredNetworkProfiles = new ArrayList<>();
for (VnicProfileView profile : networkProfiles) {
if (profile.getNetworkName().equals(networkName)) {
filteredNetworkProfiles.add(profile);
}
}
}
Aggregations