Search in sources :

Example 31 with QueryParametersBase

use of org.ovirt.engine.core.common.queries.QueryParametersBase in project ovirt-engine by oVirt.

the class AsyncDataProvider method getRoleList.

public void getRoleList(AsyncQuery<List<Role>> aQuery) {
    aQuery.converterCallback = new ListConverter<>();
    Frontend.getInstance().runQuery(QueryType.GetAllRoles, new QueryParametersBase(), aQuery);
}
Also used : QueryParametersBase(org.ovirt.engine.core.common.queries.QueryParametersBase) StorageServerConnectionQueryParametersBase(org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase)

Example 32 with QueryParametersBase

use of org.ovirt.engine.core.common.queries.QueryParametersBase in project ovirt-engine by oVirt.

the class AsyncDataProvider method getClusterList.

public void getClusterList(AsyncQuery aQuery, boolean doRefresh) {
    aQuery.converterCallback = new SortListByNameConverter<>();
    Frontend.getInstance().runQuery(QueryType.GetAllClusters, doRefresh ? new QueryParametersBase() : new QueryParametersBase().withoutRefresh(), aQuery);
}
Also used : QueryParametersBase(org.ovirt.engine.core.common.queries.QueryParametersBase) StorageServerConnectionQueryParametersBase(org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase)

Example 33 with QueryParametersBase

use of org.ovirt.engine.core.common.queries.QueryParametersBase in project ovirt-engine by oVirt.

the class AsyncDataProvider method cacheConfigValues.

/**
 * Cache configuration values [raw (not converted) values from vdc_options table].
 */
private void cacheConfigValues(AsyncQuery<Map<KeyValuePairCompat<ConfigValues, String>, Object>> aQuery) {
    aQuery.converterCallback = returnValue -> {
        if (returnValue != null) {
            cachedConfigValuesPreConvert.putAll((HashMap<KeyValuePairCompat<ConfigValues, String>, Object>) returnValue);
        }
        return cachedConfigValuesPreConvert;
    };
    Frontend.getInstance().runQuery(QueryType.GetConfigurationValues, new QueryParametersBase(), aQuery);
}
Also used : KeyValuePairCompat(org.ovirt.engine.core.compat.KeyValuePairCompat) QueryParametersBase(org.ovirt.engine.core.common.queries.QueryParametersBase) StorageServerConnectionQueryParametersBase(org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase) RefObject(org.ovirt.engine.core.compat.RefObject)

Example 34 with QueryParametersBase

use of org.ovirt.engine.core.common.queries.QueryParametersBase in project ovirt-engine by oVirt.

the class AsyncDataProvider method initMigrationPolicies.

private void initMigrationPolicies() {
    AsyncQuery<Map<Version, List<MigrationPolicy>>> aQuery = new AsyncQuery<>(returnValue -> migrationPoliciesByVersion = returnValue);
    aQuery.converterCallback = returnValue -> {
        if (returnValue == null) {
            return new HashMap<>();
        }
        Map<Version, List<MigrationPolicy>> policiesByVersion = (Map<Version, List<MigrationPolicy>>) returnValue;
        for (List<MigrationPolicy> policies : policiesByVersion.values()) {
            Collections.sort(policies, Comparator.comparing((MigrationPolicy m) -> !NoMigrationPolicy.ID.equals(m.getId())).thenComparing(MigrationPolicy::getName));
        }
        return policiesByVersion;
    };
    Frontend.getInstance().runQuery(QueryType.GetAllMigrationPolicies, new QueryParametersBase(), aQuery);
}
Also used : HashMap(java.util.HashMap) Version(org.ovirt.engine.core.compat.Version) RpmVersion(org.ovirt.engine.core.compat.RpmVersion) AsyncQuery(org.ovirt.engine.ui.frontend.AsyncQuery) QueryParametersBase(org.ovirt.engine.core.common.queries.QueryParametersBase) StorageServerConnectionQueryParametersBase(org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase) ArrayList(java.util.ArrayList) List(java.util.List) MigrationPolicy(org.ovirt.engine.core.common.migration.MigrationPolicy) NoMigrationPolicy(org.ovirt.engine.core.common.migration.NoMigrationPolicy) Map(java.util.Map) HashMap(java.util.HashMap)

Example 35 with QueryParametersBase

use of org.ovirt.engine.core.common.queries.QueryParametersBase in project ovirt-engine by oVirt.

the class AsyncDataProvider method getIsPasswordDelegationPossible.

public void getIsPasswordDelegationPossible(AsyncQuery<Boolean> asyncQuery) {
    asyncQuery.converterCallback = new CastingConverter<>();
    Frontend.getInstance().runQuery(QueryType.IsPasswordDelegationPossible, new QueryParametersBase(), asyncQuery);
}
Also used : QueryParametersBase(org.ovirt.engine.core.common.queries.QueryParametersBase) StorageServerConnectionQueryParametersBase(org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase)

Aggregations

QueryParametersBase (org.ovirt.engine.core.common.queries.QueryParametersBase)89 ArrayList (java.util.ArrayList)41 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)40 QueryType (org.ovirt.engine.core.common.queries.QueryType)37 Test (org.junit.Test)33 StorageServerConnectionQueryParametersBase (org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase)22 SearchParameters (org.ovirt.engine.core.common.queries.SearchParameters)18 List (java.util.List)15 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)15 Guid (org.ovirt.engine.core.compat.Guid)13 HashMap (java.util.HashMap)11 StatusCodeException (com.google.gwt.user.client.rpc.StatusCodeException)9 HashSet (java.util.HashSet)7 Map (java.util.Map)6 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)6 Frontend (org.ovirt.engine.ui.frontend.Frontend)6 Collection (java.util.Collection)5 Quota (org.ovirt.engine.core.common.businessentities.Quota)5 DbUser (org.ovirt.engine.core.common.businessentities.aaa.DbUser)5 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)5