use of org.ovirt.engine.core.common.queries.GetAllProvidersParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getAllProvidersByType.
public void getAllProvidersByType(AsyncQuery<List<Provider<?>>> aQuery, ProviderType... providerTypes) {
aQuery.converterCallback = new ListConverter<>();
Frontend.getInstance().runQuery(QueryType.GetAllProviders, new GetAllProvidersParameters(providerTypes), aQuery);
}
use of org.ovirt.engine.core.common.queries.GetAllProvidersParameters in project ovirt-engine by oVirt.
the class BackendOpenStackNetworkProvidersResource method getBackendCollection.
private List<Provider> getBackendCollection() {
if (isFiltered()) {
return getBackendCollection(QueryType.GetAllProviders, new GetAllProvidersParameters(ProviderType.OPENSTACK_NETWORK, ProviderType.EXTERNAL_NETWORK));
} else {
List<Provider> openstackCollection = getBackendCollection(SearchType.Provider, getConstraint(ProviderType.OPENSTACK_NETWORK.name()));
List<Provider> externalCollection = getBackendCollection(SearchType.Provider, getConstraint(ProviderType.EXTERNAL_NETWORK.name()));
openstackCollection.addAll(externalCollection);
return openstackCollection;
}
}
use of org.ovirt.engine.core.common.queries.GetAllProvidersParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getAllProviders.
public void getAllProviders(AsyncQuery<List<Provider<?>>> aQuery, boolean doRefresh) {
aQuery.converterCallback = new SortListByNameConverter<>();
Frontend.getInstance().runQuery(QueryType.GetAllProviders, doRefresh ? new GetAllProvidersParameters() : new GetAllProvidersParameters().withoutRefresh(), aQuery);
}
use of org.ovirt.engine.core.common.queries.GetAllProvidersParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getAllProvidersByProvidedEntity.
public void getAllProvidersByProvidedEntity(AsyncQuery<List<Provider<?>>> query, final VdcObjectType providedEntity) {
query.converterCallback = returnValue -> {
if (returnValue == null) {
return new ArrayList<>();
}
return ((Collection<Provider<?>>) returnValue).stream().filter(p -> p.getType().getProvidedTypes().contains(providedEntity)).sorted(new NameableComparator()).collect(Collectors.toList());
};
Frontend.getInstance().runQuery(QueryType.GetAllProviders, new GetAllProvidersParameters(), query);
}
Aggregations