Search in sources :

Example 41 with SearchParameters

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);
}
Also used : SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters)

Example 42 with SearchParameters

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);
}
Also used : SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters)

Example 43 with SearchParameters

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);
}
Also used : SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters)

Example 44 with SearchParameters

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);
}
Also used : SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) ArrayList(java.util.ArrayList)

Example 45 with SearchParameters

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);
}
Also used : SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters)

Aggregations

SearchParameters (org.ovirt.engine.core.common.queries.SearchParameters)58 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)19 Test (org.junit.Test)17 QueryParametersBase (org.ovirt.engine.core.common.queries.QueryParametersBase)17 ArrayList (java.util.ArrayList)15 QueryType (org.ovirt.engine.core.common.queries.QueryType)12 StatusCodeException (com.google.gwt.user.client.rpc.StatusCodeException)9 SearchType (org.ovirt.engine.core.common.interfaces.SearchType)7 Frontend (org.ovirt.engine.ui.frontend.Frontend)7 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)7 List (java.util.List)6 Guid (org.ovirt.engine.core.compat.Guid)6 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)6 VDS (org.ovirt.engine.core.common.businessentities.VDS)5 PropertyChangedEventArgs (org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs)5 UIConstants (org.ovirt.engine.ui.uicompat.UIConstants)5 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)4 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)4 ListModel (org.ovirt.engine.ui.uicommonweb.models.ListModel)4 EnumTranslator (org.ovirt.engine.ui.uicompat.EnumTranslator)4