private List<String> getDomainList() { return getBackendCollection( String.class, QueryType.GetDomainList, new QueryParametersBase()); }
@Override public SchedulingPolicies list() { List<ClusterPolicy> SchedulingPolicys = getBackendCollection(QueryType.GetClusterPolicies, new QueryParametersBase()); return mapCollection(SchedulingPolicys); }
@Override public AffinityLabels list() { return mapCollection( getBackendCollection( QueryType.GetAllLabels, new QueryParametersBase())); }
@Override public StorageConnections list() { return mapCollection(getBackendCollection(QueryType.GetAllStorageServerConnections, new QueryParametersBase())); }
@Override public NetworkFilters list() { return mapCollection(getBackendCollection(QueryType.GetAllNetworkFilters, new QueryParametersBase())); }
@Override public Disks list() { //Even when filter=false the stored procedure GetAllDisksWithSnapshots is needed because of the //snapshot aggregation which it provides, so search alone is not enough. This is why in this case //the scenarios of filter=true and filter=false are not separated as they are in many other places return mapCollection(getBackendCollection(QueryType.GetAllDisksWithSnapshots, new QueryParametersBase(), SearchType.Disk)); }
private void initOsDefaultIconIds() { Frontend.getInstance().runQuery(QueryType.GetVmIconDefaults, new QueryParametersBase(), new AsyncQuery<QueryReturnValue>(returnValue -> { final Map<Integer, VmIconIdSizePair> returnMap = returnValue.getReturnValue(); if (returnMap.get(DEFAULT_OS_ID) == null) { throw new RuntimeException("Engine did not provide icon IDs of default OS."); //$NON-NLS-1$ } osIdToDefaultIconIdMap = Collections.unmodifiableMap(returnMap); initializeLargeToSmallIconMap(); })); }
private Guid getStorageDomainIdByName(String storageDomainName) { List<org.ovirt.engine.core.common.businessentities.StorageDomain> storageDomains = getBackendCollection(org.ovirt.engine.core.common.businessentities.StorageDomain.class, QueryType.GetAllStorageDomains, new QueryParametersBase()); for (org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains) { if (storageDomain.getStorageName().equals(storageDomainName)) { return storageDomain.getId(); } } return null; }
public void getClustersHavingHosts(AsyncQuery<List<Cluster>> aQuery) { aQuery.converterCallback = new SortListByNameConverter<>(); Frontend.getInstance().runQuery(QueryType.GetAllClustersHavingHosts, new QueryParametersBase(), aQuery); }
public void getIsPasswordDelegationPossible(AsyncQuery<Boolean> asyncQuery) { asyncQuery.converterCallback = new CastingConverter<>(); Frontend.getInstance().runQuery(QueryType.IsPasswordDelegationPossible, new QueryParametersBase(), asyncQuery); }
@Override public Jobs list() { List<org.ovirt.engine.core.common.job.Job> jobs; if (isFiltered()) { jobs = getBackendCollection(QueryType.GetAllJobs, new QueryParametersBase()); } else { jobs = getBackendCollection(SearchType.Job); } return mapCollection(jobs); }
@Override public DataCenters list() { if (isFiltered()) { return mapCollection(getBackendCollection(QueryType.GetAllStoragePools, new QueryParametersBase())); } else { return mapCollection(getBackendCollection(SearchType.StoragePool)); } }
@Override public Templates list() { if (isFiltered()) { return mapCollection(getBackendCollection(QueryType.GetAllVmTemplates, new QueryParametersBase(), SearchType.VmTemplate)); } else { return mapCollection(getBackendCollection(SearchType.VmTemplate)); } }
@Override public StorageDomains list() { if (isFiltered()) { return mapCollection(getBackendCollection(QueryType.GetAllStorageDomains, new QueryParametersBase(), SearchType.StorageDomain)); } else { return mapCollection(getBackendCollection(SearchType.StorageDomain)); } }
@Override protected void syncSearch() { super.syncSearch(); QueryParametersBase params = new QueryParametersBase(); params.setRefresh(false); Frontend.getInstance().runQuery(QueryType.GetSystemPermissions, params, new SetItemsAsyncQuery()); }
private Clusters listVirtOnly() { if (isFiltered()) { return mapVirtOnlyCollection(getBackendCollection(QueryType.GetAllClusters, new QueryParametersBase())); } else { return mapVirtOnlyCollection(getBackendCollection(SearchType.Cluster)); } }
private Clusters listAll() { if (isFiltered()) { return mapCollection(getBackendCollection(QueryType.GetAllClusters, new QueryParametersBase())); } else { return mapCollection(getBackendCollection(SearchType.Cluster)); } }
@Test public void testAddOperationMultipleQuery() { VdcOperation<QueryType, QueryParametersBase> testOperation = new VdcOperation<>(QueryType.Search, new QueryParametersBase().withRefresh(), null); testManager.addOperation(testOperation); verify(mockOperationProcessor).processOperation(testManager); verify(mockEventBus).fireEvent(any()); // Second add, shouldn't add and generate an event. testManager.addOperation(testOperation); // Verify it is only called once (from before) verify(mockOperationProcessor).processOperation(testManager); verify(mockEventBus).fireEvent(any()); }
protected Object runQuery(QueryType queryType, String sessionId, InitialContext ctx) { QueryParametersBase queryParams = new QueryParametersBase(); queryParams.setSessionId(sessionId); queryParams.setFiltered(FILTER_QUERIES); QueryReturnValue result = FiltersHelper.getBackend(ctx).runQuery(queryType, queryParams); return result != null && result.getSucceeded() ? result.getReturnValue() : null; }
public Users list() { if (isFiltered()) { return mapDbUserCollection(getBackendCollection(QueryType.GetAllDbUsers, new QueryParametersBase(), SearchType.DBUser)); } else { return mapDbUserCollection(getBackendCollection(SearchType.DBUser, getSearchPattern())); } }