use of org.ovirt.engine.core.common.queries.IdAndBooleanQueryParameters in project ovirt-engine by oVirt.
the class StorageRegisterDiskImageListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() == null) {
setItems(null);
return;
}
IdQueryParameters parameters = new IdAndBooleanQueryParameters(getEntity().getId(), true);
parameters.setRefresh(getIsQueryFirstTime());
Frontend.getInstance().runQuery(QueryType.GetUnregisteredDisksFromDB, parameters, new AsyncQuery<QueryReturnValue>(returnValue -> {
List<UnregisteredDisk> unregisteredDisks = returnValue.getReturnValue();
Collections.sort(unregisteredDisks, Comparator.comparing(UnregisteredDisk::getDiskAlias));
ArrayList<Disk> diskItems = new ArrayList<>();
for (UnregisteredDisk unregisteredDisk : unregisteredDisks) {
diskItems.add(unregisteredDisk.getDiskImage());
}
setItems(diskItems);
}));
}
Aggregations