use of org.ovirt.engine.ui.frontend.AsyncCallback in project ovirt-engine by oVirt.
the class ClusterNetworkListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() == null) {
return;
}
super.syncSearch();
Guid clusterId = getEntity().getId();
IdQueryParameters tempVar = new IdQueryParameters(clusterId);
tempVar.setRefresh(getIsQueryFirstTime());
Frontend.getInstance().runQuery(QueryType.GetAllNetworksByClusterId, tempVar, new AsyncQuery<>((AsyncCallback<QueryReturnValue>) returnValue -> {
final List<Network> newItems = returnValue.getReturnValue();
Collections.sort(newItems, Comparator.comparing((Network n) -> n.getCluster().isManagement()).reversed().thenComparing(Network::getName, new LexoNumericComparator()));
for (Network network : newItems) {
network.getCluster().setId(new NetworkClusterId(clusterId, network.getId()));
}
setItems(newItems);
}));
}
Aggregations