use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class StorageDomainHelper method addAttachedDataCenterReferences.
/**
* Adds to the given Storage Domain the references to the Data Centers it is attached to.
*
* @param resource the resource that will be used to run the required queries
* @param model the model of the Storage Domain where the references will be added
*/
public static void addAttachedDataCenterReferences(BackendResource resource, StorageDomain model) {
// Note that this implementation is far from efficient, as we are retrieving all the content of the Storage
// Domains and immediately discarding everything but the identifiers of the Data Centers. It would be better to
// have a query that returns only the identifiers.
Guid id = Guid.createGuidFromString(model.getId());
QueryReturnValue result = resource.runQuery(QueryType.GetStorageDomainListById, new IdQueryParameters(id));
if (result != null && result.getSucceeded()) {
List<org.ovirt.engine.core.common.businessentities.StorageDomain> storageDomains = result.getReturnValue();
if (CollectionUtils.isNotEmpty(storageDomains)) {
DataCenters dataCenters = new DataCenters();
for (org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains) {
DataCenter dataCenter = new DataCenter();
dataCenter.setId(storageDomain.getStoragePoolId().toString());
dataCenters.getDataCenters().add(dataCenter);
}
model.setDataCenters(dataCenters);
}
}
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getRoleActionGroupsByRoleId.
public void getRoleActionGroupsByRoleId(AsyncQuery<List<ActionGroup>> aQuery, Guid roleId) {
aQuery.converterCallback = new ListConverter<>();
Frontend.getInstance().runQuery(QueryType.GetRoleActionGroupsByRoleId, new IdQueryParameters(roleId), aQuery);
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getAllNetworkQos.
public void getAllNetworkQos(Guid dcId, AsyncQuery<List<NetworkQoS>> query) {
query.converterCallback = new ListConverter<NetworkQoS>() {
@Override
public List<NetworkQoS> convert(List<NetworkQoS> returnValue) {
List<NetworkQoS> qosList = super.convert(returnValue);
qosList.add(0, NetworkQoSModel.EMPTY_QOS);
return qosList;
}
};
Frontend.getInstance().runQuery(QueryType.GetAllNetworkQosByStoragePoolId, new IdQueryParameters(dcId), query);
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getVmsPinnedToHost.
public void getVmsPinnedToHost(AsyncQuery<List<VM>> aQuery, Guid id) {
aQuery.converterCallback = new ListConverter<>();
Frontend.getInstance().runQuery(QueryType.GetVmsPinnedToHost, new IdQueryParameters(id), aQuery);
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getHostListByClusterId.
public void getHostListByClusterId(AsyncQuery<List<VDS>> aQuery, Guid clusterId) {
aQuery.converterCallback = new ListConverter<>();
Frontend.getInstance().runQuery(QueryType.GetHostsByClusterId, new IdQueryParameters(clusterId), aQuery);
}
Aggregations