use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class ClusterListModel method checkForNonResponsiveHosts.
/**
* Checks if in selected cluster are some non responsive hosts. If so, it adds warning about upgrading cluster level
* when some hosts are non responsive
*/
@SuppressWarnings("unchecked")
private void checkForNonResponsiveHosts(final ConfirmationModel confirmModel) {
startProgress();
Frontend.getInstance().runQuery(QueryType.GetHostsByClusterId, new IdQueryParameters(getSelectedItem().getId()), new AsyncQuery<>(returnValue -> {
List<VDS> hosts = null;
if (returnValue instanceof List) {
hosts = (List<VDS>) returnValue;
} else if (returnValue instanceof QueryReturnValue && ((QueryReturnValue) returnValue).getReturnValue() instanceof List) {
hosts = ((QueryReturnValue) returnValue).getReturnValue();
}
boolean foundNRHosts = false;
if (hosts != null) {
for (VDS host : hosts) {
if (VDSStatus.NonResponsive == host.getStatus()) {
foundNRHosts = true;
break;
}
}
}
String existingMsg = confirmModel.getMessage() == null ? "" : confirmModel.getMessage();
if (foundNRHosts) {
confirmModel.setMessage(existingMsg + constants.youAreAboutChangeClusterCompatibilityVersionNonResponsiveHostsMsg());
} else {
confirmModel.setMessage(existingMsg + constants.youAreAboutChangeClusterCompatibilityVersionMsg());
}
stopProgress();
}));
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class ClusterGeneralModel method updateConsoleAddressPartiallyOverridden.
private void updateConsoleAddressPartiallyOverridden(Cluster cluster) {
AsyncQuery<QueryReturnValue> query = new AsyncQuery<>(returnValue -> {
boolean isConsistent = returnValue.getReturnValue();
setConsoleAddressPartiallyOverridden(!isConsistent);
});
Frontend.getInstance().runQuery(QueryType.IsDisplayAddressConsistentInCluster, new IdQueryParameters(cluster.getId()), query);
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class RoleListModel method eventRaised.
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
super.eventRaised(ev, sender, args);
if (getWindow() != null && sender == ((RoleModel) getWindow()).getIsAdminRole()) {
if (commandType == CommandType.New) {
List<ActionGroup> selectedActionGroups = new ArrayList<>();
selectedActionGroups.add(ActionGroup.LOGIN);
setAttachedActionGroups(selectedActionGroups);
} else {
Role role = getSelectedItem();
Frontend.getInstance().runQuery(QueryType.GetRoleActionGroupsByRoleId, new IdQueryParameters(role.getId()), new AsyncQuery<QueryReturnValue>(returnValue -> {
publicAttachedActions = returnValue.getReturnValue();
setAttachedActionGroups(publicAttachedActions);
}));
}
}
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class NetworkTemplateListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() == null) {
return;
}
IdQueryParameters params = new IdQueryParameters(getEntity().getId());
params.setRefresh(getIsQueryFirstTime());
Frontend.getInstance().runQuery(QueryType.GetVmTemplatesAndNetworkInterfacesByNetworkId, params, new SetItemsAsyncQuery());
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters 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();
}
}));
}
}
Aggregations