use of org.ovirt.engine.core.common.queries.QueryReturnValue in project ovirt-engine by oVirt.
the class GwtDynamicHostPageServlet method runQuery.
/**
* Executes a backend {@linkplain BackendLocal#runQuery query} and returns its result value if successful.
* <p>
* Returns {@code null} otherwise.
*/
protected Object runQuery(QueryType queryType, QueryParametersBase queryParams, String sessionId) {
initQueryParams(queryParams, sessionId);
QueryReturnValue result = backend.runQuery(queryType, queryParams);
return result != null && result.getSucceeded() ? result.getReturnValue() : null;
}
use of org.ovirt.engine.core.common.queries.QueryReturnValue in project ovirt-engine by oVirt.
the class AsyncDataProvider method getDefaultConfigurationVersion.
private void getDefaultConfigurationVersion(final LoginModel loginModel) {
AsyncQuery<QueryReturnValue> callback = new AsyncQuery<>(returnValue -> {
if (returnValue != null) {
_defaultConfigurationVersion = ((QueryReturnValue) returnValue).getReturnValue();
} else {
_defaultConfigurationVersion = GENERAL;
}
loginModel.getLoggedInEvent().raise(loginModel, EventArgs.EMPTY);
});
callback.setHandleFailure(true);
Frontend.getInstance().runQuery(QueryType.GetDefaultConfigurationVersion, new QueryParametersBase(), callback);
}
use of org.ovirt.engine.core.common.queries.QueryReturnValue in project ovirt-engine by oVirt.
the class HostSetupNetworksModel method queryFreeBonds.
private void queryFreeBonds() {
// query for all unused, existing bonds on the host
VDS vds = getEntity();
Frontend.getInstance().runQuery(QueryType.GetVdsFreeBondsByVdsId, new IdQueryParameters(vds.getId()), new AsyncQuery<QueryReturnValue>(returnValue -> {
allBonds = returnValue.getReturnValue();
queryTLVInformation();
initNetworkModels();
initNicModels();
stopProgress();
}));
}
use of org.ovirt.engine.core.common.queries.QueryReturnValue in project ovirt-engine by oVirt.
the class HostSetupNetworksModel method queryInterfaces.
private void queryInterfaces() {
VDS vds = getEntity();
IdQueryParameters params = new IdQueryParameters(vds.getId());
params.setRefresh(false);
// query for interfaces
Frontend.getInstance().runQuery(QueryType.GetVdsInterfacesByVdsId, params, new AsyncQuery<>((QueryReturnValue returnValue) -> {
allExistingNics = returnValue.getReturnValue();
existingVlanDevicesByVlanId = mapVlanDevicesByVlanId();
initCreateOrUpdateBondParameters();
initNicLabelsParameters();
// chain the network attachments query
queryNetworkAttachments();
}));
}
use of org.ovirt.engine.core.common.queries.QueryReturnValue in project ovirt-engine by oVirt.
the class HostSetupNetworksModel method queryNetworkAttachments.
private void queryNetworkAttachments() {
VDS vds = getEntity();
IdQueryParameters params = new IdQueryParameters(vds.getId());
params.setRefresh(false);
// query for network attachments
Frontend.getInstance().runQuery(QueryType.GetNetworkAttachmentsByHostId, params, new AsyncQuery<>((QueryReturnValue returnValue) -> {
hostSetupNetworksParametersData.getNetworkAttachments().addAll((List<NetworkAttachment>) returnValue.getReturnValue());
initNetworkIdToExistingAttachmentMap();
// chain the vfsConfig query
queryVfsConfig();
}));
}
Aggregations