use of org.ovirt.engine.core.common.queries.QueryReturnValue in project ovirt-engine by oVirt.
the class PoolDiskListModel method onEntityChanged.
@Override
protected void onEntityChanged() {
super.onEntityChanged();
VmPool pool = getEntity();
if (pool != null) {
Frontend.getInstance().runQuery(QueryType.GetVmDataByPoolId, new IdQueryParameters(pool.getVmPoolId()), new AsyncQuery<QueryReturnValue>(result -> {
if (result != null) {
VM vm = result.getReturnValue();
if (vm == null) {
return;
}
setVM(vm);
syncSearch();
}
}));
}
}
use of org.ovirt.engine.core.common.queries.QueryReturnValue in project ovirt-engine by oVirt.
the class PoolInterfaceListModel method onEntityChanged.
@Override
protected void onEntityChanged() {
super.onEntityChanged();
VmPool pool = getEntity();
if (pool != null) {
Frontend.getInstance().runQuery(QueryType.GetVmDataByPoolId, new IdQueryParameters(pool.getVmPoolId()), new AsyncQuery<QueryReturnValue>(result -> {
if (result != null) {
VM vm = result.getReturnValue();
if (vm == null) {
return;
}
syncSearch(QueryType.GetVmInterfacesByVmId, new IdQueryParameters(vm.getId()));
}
}));
}
}
use of org.ovirt.engine.core.common.queries.QueryReturnValue in project ovirt-engine by oVirt.
the class QuotaUserListModel method syncSearch.
@Override
protected void syncSearch() {
super.syncSearch();
IdQueryParameters param = new IdQueryParameters(getEntity().getId());
param.setRefresh(getIsQueryFirstTime());
param.setRefresh(getIsQueryFirstTime());
Frontend.getInstance().runQuery(QueryType.GetPermissionsToConsumeQuotaByQuotaId, param, new AsyncQuery<QueryReturnValue>(returnValue -> {
ArrayList<Permission> list = returnValue.getReturnValue();
Map<Guid, Permission> map = new HashMap<>();
for (Permission permission : list) {
// filter out sys-admin and dc admin from consumers sub-tab
if (permission.getRoleId().equals(ApplicationGuids.superUser.asGuid()) || permission.getRoleId().equals(ApplicationGuids.dataCenterAdmin.asGuid())) {
continue;
}
if (!map.containsKey(permission.getAdElementId())) {
map.put(permission.getAdElementId(), permission);
} else {
if (map.get(permission.getAdElementId()).getRoleId().equals(ApplicationGuids.quotaConsumer.asGuid())) {
map.put(permission.getAdElementId(), permission);
}
}
}
list.clear();
for (Permission permission : map.values()) {
list.add(permission);
}
setItems(list);
}));
setIsQueryFirstTime(false);
}
use of org.ovirt.engine.core.common.queries.QueryReturnValue in project ovirt-engine by oVirt.
the class QuotaVmListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() == null) {
return;
}
super.syncSearch();
IdQueryParameters tempVar = new IdQueryParameters(getEntity().getId());
tempVar.setRefresh(getIsQueryFirstTime());
Frontend.getInstance().runQuery(QueryType.GetVmsRelatedToQuotaId, tempVar, new AsyncQuery<QueryReturnValue>(returnValue -> {
setItems((ArrayList<VM>) returnValue.getReturnValue());
setIsEmpty(((List) getItems()).size() == 0);
}));
}
use of org.ovirt.engine.core.common.queries.QueryReturnValue in project ovirt-engine by oVirt.
the class DownloadImageHandler method start.
public void start() {
Frontend.getInstance().runAction(ActionType.TransferDiskImage, createInitParams(), result -> {
if (result.getReturnValue().getSucceeded()) {
Guid transferId = result.getReturnValue().getActionReturnValue();
Frontend.getInstance().runQuery(QueryType.GetImageTransferById, new IdQueryParameters(transferId), new AsyncQuery<QueryReturnValue>(returnValue -> {
ImageTransfer imageTransfer = returnValue.getReturnValue();
initiateDownload(imageTransfer);
}));
}
}, this);
}
Aggregations