use of org.ovirt.engine.core.common.queries.SearchParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getDataCenterList.
public void getDataCenterList(AsyncQuery<List<StoragePool>> aQuery, boolean doRefresh) {
aQuery.converterCallback = new ListConverter<>();
// $NON-NLS-1$
SearchParameters params = new SearchParameters("DataCenter: sortby name", SearchType.StoragePool);
Frontend.getInstance().runQuery(QueryType.Search, doRefresh ? params : params.withoutRefresh(), aQuery);
}
use of org.ovirt.engine.core.common.queries.SearchParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getDiskList.
public void getDiskList(AsyncQuery<List<DiskImage>> aQuery) {
aQuery.converterCallback = new ListConverter<>();
// $NON-NLS-1$
SearchParameters searchParams = new SearchParameters("Disks:", SearchType.Disk);
searchParams.setMaxCount(9999);
Frontend.getInstance().runQuery(QueryType.Search, searchParams, aQuery);
}
use of org.ovirt.engine.core.common.queries.SearchParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getUpHostListByCluster.
public void getUpHostListByCluster(AsyncQuery aQuery, String clusterName, Integer maxCount) {
SearchParameters searchParameters = // $NON-NLS-1$ //$NON-NLS-2$
new SearchParameters("Host: cluster = " + clusterName + " and status = up", SearchType.VDS);
if (maxCount != null) {
searchParameters.setMaxCount(maxCount);
}
Frontend.getInstance().runQuery(QueryType.Search, searchParameters, aQuery);
}
use of org.ovirt.engine.core.common.queries.SearchParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getISOStorageDomainList.
public void getISOStorageDomainList(AsyncQuery<List<StorageDomain>> aQuery) {
aQuery.converterCallback = source -> {
if (source != null) {
ArrayList<StorageDomain> allStorageDomains = (ArrayList<StorageDomain>) source;
ArrayList<StorageDomain> isoStorageDomains = new ArrayList<>();
for (StorageDomain storageDomain : allStorageDomains) {
if (storageDomain.getStorageDomainType() == StorageDomainType.ISO) {
isoStorageDomains.add(storageDomain);
}
}
return isoStorageDomains;
}
return new ArrayList<>();
};
// $NON-NLS-1$
SearchParameters searchParams = new SearchParameters("Storage:", SearchType.StorageDomain);
searchParams.setMaxCount(9999);
Frontend.getInstance().runQuery(QueryType.Search, searchParams, aQuery);
}
use of org.ovirt.engine.core.common.queries.SearchParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getLocalStorageHost.
public void getLocalStorageHost(AsyncQuery<VDS> aQuery, String dataCenterName) {
aQuery.converterCallback = new GetFirstConverter<>();
// $NON-NLS-1$
SearchParameters sp = new SearchParameters("hosts: datacenter=" + dataCenterName, SearchType.VDS);
Frontend.getInstance().runQuery(QueryType.Search, sp, aQuery);
}
Aggregations