use of org.ovirt.engine.core.common.queries.GetVmTemplatesFromStorageDomainParameters in project ovirt-engine by oVirt.
the class StorageTemplateListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() == null) {
return;
}
super.syncSearch();
GetVmTemplatesFromStorageDomainParameters tempVar = new GetVmTemplatesFromStorageDomainParameters(getEntity().getId(), true);
tempVar.setRefresh(getIsQueryFirstTime());
Frontend.getInstance().runQuery(QueryType.GetVmTemplatesFromStorageDomain, tempVar, new AsyncQuery<QueryReturnValue>(returnValue -> {
ArrayList<VmTemplate> templates = returnValue.getReturnValue();
Collections.sort(templates, new LexoNumericNameableComparator<>());
setItems(templates);
setIsEmpty(templates.size() == 0);
}));
}
use of org.ovirt.engine.core.common.queries.GetVmTemplatesFromStorageDomainParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getTemplateListByStorage.
public void getTemplateListByStorage(AsyncQuery<List<VmTemplate>> aQuery, Guid storageId) {
aQuery.converterCallback = source -> {
ArrayList<VmTemplate> list = new ArrayList<>();
if (source != null) {
for (VmTemplate template : (ArrayList<VmTemplate>) source) {
if (template.getStatus() == VmTemplateStatus.OK) {
list.add(template);
}
}
Collections.sort(list, new NameableComparator());
}
return list;
};
Frontend.getInstance().runQuery(QueryType.GetVmTemplatesFromStorageDomain, new GetVmTemplatesFromStorageDomainParameters(storageId, false), aQuery);
}
Aggregations