use of org.ovirt.engine.core.common.queries.SearchParameters in project ovirt-engine by oVirt.
the class GuideModel method checkVdsClusterChangeSucceeded.
protected void checkVdsClusterChangeSucceeded(final String searchStr, final List<ActionParametersBase> changeVdsParameterList, final List<ActionParametersBase> activateVdsParameterList) {
final Map<Guid, Guid> hostClusterIdMap = new HashMap<>();
for (ActionParametersBase param : changeVdsParameterList) {
hostClusterIdMap.put(((ChangeVDSClusterParameters) param).getVdsId(), ((ChangeVDSClusterParameters) param).getClusterId());
}
Frontend.getInstance().runQuery(QueryType.Search, new SearchParameters(searchStr, SearchType.VDS), new AsyncQuery<QueryReturnValue>(returnValue -> {
List<VDS> hosts = returnValue.getReturnValue();
boolean succeeded = true;
for (VDS host : hosts) {
if (!host.getClusterId().equals(hostClusterIdMap.get(host.getId()))) {
succeeded = false;
}
}
if (!succeeded) {
getWindow().stopProgress();
cancel();
errorPopupManager.show(ConstantsManager.getInstance().getConstants().hostChangeClusterTimeOut());
} else {
activateHostsAfterClusterChange(searchStr, activateVdsParameterList);
}
}));
}
use of org.ovirt.engine.core.common.queries.SearchParameters in project ovirt-engine by oVirt.
the class SessionListModel method syncSearch.
@Override
protected void syncSearch() {
SearchParameters searchParameters = new SearchParameters(applySortOptions(getSearchString()), SearchType.Session, isCaseSensitiveSearch());
searchParameters.setMaxCount(getSearchPageSize());
super.syncSearch(QueryType.Search, searchParameters);
}
use of org.ovirt.engine.core.common.queries.SearchParameters in project ovirt-engine by oVirt.
the class VmListModel method syncSearch.
@Override
protected void syncSearch() {
SearchParameters tempVar = new SearchParameters(applySortOptions(getModifiedSearchString()), SearchType.VM, isCaseSensitiveSearch());
tempVar.setMaxCount(getSearchPageSize());
super.syncSearch(QueryType.Search, tempVar);
}
use of org.ovirt.engine.core.common.queries.SearchParameters in project ovirt-engine by oVirt.
the class AbstractBackendCollectionResource method getSearchParameters.
private SearchParameters getSearchParameters(SearchType searchType, String constraint) {
SearchParameters searchParams = new SearchParameters(constraint, searchType);
boolean caseSensitive = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, CASE_SENSITIVE_CONSTRAINT_PARAMETER, true, false);
int from = ParametersHelper.getIntegerParameter(httpHeaders, uriInfo, FROM_CONSTRAINT_PARAMETER, -1, -1);
int max = ParametersHelper.getIntegerParameter(httpHeaders, uriInfo, MAX, Integer.MAX_VALUE, Integer.MAX_VALUE);
searchParams.setCaseSensitive(caseSensitive);
if (from != -1) {
searchParams.setSearchFrom(from);
}
searchParams.setMaxCount(max);
return searchParams;
}
use of org.ovirt.engine.core.common.queries.SearchParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getHostListByStatus.
public void getHostListByStatus(AsyncQuery<List<VDS>> aQuery, VDSStatus status, boolean doRefresh) {
aQuery.converterCallback = new ListConverter<>();
SearchParameters searchParameters = // $NON-NLS-1$ //$NON-NLS-2$
new SearchParameters("Host: " + (status == null ? "" : ("status=" + status.name())), SearchType.VDS);
searchParameters.setMaxCount(9999);
Frontend.getInstance().runQuery(QueryType.Search, doRefresh ? searchParameters : searchParameters.withoutRefresh(), aQuery);
}
Aggregations