Search in sources :

Example 1 with GetAgentFenceOptionsQueryParameters

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

the class AsyncDataProvider method getPmOptions.

public void getPmOptions(AsyncQuery<List<String>> aQuery, final String pmType, String version) {
    aQuery.converterCallback = source -> {
        HashMap<String, ArrayList<String>> cachedPmMap = new HashMap<>();
        HashMap<String, HashMap<String, Object>> dict = (HashMap<String, HashMap<String, Object>>) source;
        for (Entry<String, HashMap<String, Object>> pair : dict.entrySet()) {
            ArrayList<String> list = new ArrayList<>();
            for (Entry<String, Object> p : pair.getValue().entrySet()) {
                list.add(p.getKey());
            }
            cachedPmMap.put(pair.getKey(), list);
        }
        return cachedPmMap.get(pmType);
    };
    Frontend.getInstance().runQuery(QueryType.GetAgentFenceOptions, new GetAgentFenceOptionsQueryParameters(version), aQuery);
}
Also used : GetAgentFenceOptionsQueryParameters(org.ovirt.engine.core.common.queries.GetAgentFenceOptionsQueryParameters) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) RefObject(org.ovirt.engine.core.compat.RefObject)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 GetAgentFenceOptionsQueryParameters (org.ovirt.engine.core.common.queries.GetAgentFenceOptionsQueryParameters)1 RefObject (org.ovirt.engine.core.compat.RefObject)1