Search in sources :

Example 1 with QosQueryParameterBase

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

the class AbstractBackendCpuProfilesResource method handleQosDataCenterLinks.

/**
 * used to set qos's href (requires dc id).
 */
private void handleQosDataCenterLinks(Map<Guid, Qos> qosMap) {
    if (!qosMap.isEmpty()) {
        List<CpuQos> list = getBackendCollection(CpuQos.class, QueryType.GetAllQosByType, new QosQueryParameterBase(null, QosType.CPU));
        for (CpuQos cpuQos : list) {
            Qos qos = qosMap.get(cpuQos.getId());
            if (qos != null) {
                qos.setDataCenter(new DataCenter());
                qos.getDataCenter().setId(cpuQos.getStoragePoolId().toString());
            }
        }
    }
}
Also used : QosQueryParameterBase(org.ovirt.engine.core.common.queries.QosQueryParameterBase) DataCenter(org.ovirt.engine.api.model.DataCenter) Qos(org.ovirt.engine.api.model.Qos) CpuQos(org.ovirt.engine.core.common.businessentities.qos.CpuQos) CpuQos(org.ovirt.engine.core.common.businessentities.qos.CpuQos)

Example 2 with QosQueryParameterBase

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

the class AbstractBackendDiskProfilesResource method handleQosDataCenterLinks.

/**
 * used to set qos's href (requires dc id).
 */
private void handleQosDataCenterLinks(Map<Guid, Qos> qosMap) {
    if (!qosMap.isEmpty()) {
        List<StorageQos> list = getBackendCollection(StorageQos.class, QueryType.GetAllQosByType, new QosQueryParameterBase(null, QosType.STORAGE));
        for (StorageQos storageQos : list) {
            Qos qos = qosMap.get(storageQos.getId());
            if (qos != null) {
                qos.setDataCenter(new DataCenter());
                qos.getDataCenter().setId(storageQos.getStoragePoolId().toString());
            }
        }
    }
}
Also used : StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos) QosQueryParameterBase(org.ovirt.engine.core.common.queries.QosQueryParameterBase) DataCenter(org.ovirt.engine.api.model.DataCenter) Qos(org.ovirt.engine.api.model.Qos) StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos)

Example 3 with QosQueryParameterBase

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

the class AbstractBackendVnicProfilesResource method handleQosDataCenterLinks.

/**
 * used to set qos's href (requires dc id).
 */
private void handleQosDataCenterLinks(Map<Guid, Qos> qosMap) {
    if (!qosMap.isEmpty()) {
        List<NetworkQoS> list = getBackendCollection(NetworkQoS.class, QueryType.GetAllQosByType, new QosQueryParameterBase(null, QosType.NETWORK));
        for (NetworkQoS networkQoS : list) {
            Qos qos = qosMap.get(networkQoS.getId());
            if (qos != null) {
                qos.setDataCenter(new DataCenter());
                qos.getDataCenter().setId(networkQoS.getStoragePoolId().toString());
            }
        }
    }
}
Also used : QosQueryParameterBase(org.ovirt.engine.core.common.queries.QosQueryParameterBase) DataCenter(org.ovirt.engine.api.model.DataCenter) Qos(org.ovirt.engine.api.model.Qos) NetworkQoS(org.ovirt.engine.core.common.businessentities.network.NetworkQoS)

Example 4 with QosQueryParameterBase

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

the class AsyncDataProvider method getAllHostNetworkQos.

public void getAllHostNetworkQos(Guid dcId, AsyncQuery<List<HostNetworkQos>> query) {
    query.converterCallback = new ListConverter<HostNetworkQos>() {

        @Override
        public List<HostNetworkQos> convert(List<HostNetworkQos> returnValue) {
            List<HostNetworkQos> qosList = super.convert(returnValue);
            qosList.add(0, NetworkModel.EMPTY_HOST_NETWORK_QOS);
            return qosList;
        }
    };
    Frontend.getInstance().runQuery(QueryType.GetAllQosByStoragePoolIdAndType, new QosQueryParameterBase(dcId, QosType.HOSTNETWORK), query);
}
Also used : HostNetworkQos(org.ovirt.engine.core.common.businessentities.network.HostNetworkQos) QosQueryParameterBase(org.ovirt.engine.core.common.queries.QosQueryParameterBase) ArrayList(java.util.ArrayList) List(java.util.List)

Example 5 with QosQueryParameterBase

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

the class DataCenterQosListModel method syncSearch.

@Override
protected void syncSearch() {
    if (getEntity() == null) {
        return;
    }
    IdQueryParameters parameters = new QosQueryParameterBase(getEntity().getId(), getQosType());
    parameters.setRefresh(getIsQueryFirstTime());
    Frontend.getInstance().runQuery(QueryType.GetAllQosByStoragePoolIdAndType, parameters, new SetItemsAsyncQuery());
}
Also used : QosQueryParameterBase(org.ovirt.engine.core.common.queries.QosQueryParameterBase) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters)

Aggregations

QosQueryParameterBase (org.ovirt.engine.core.common.queries.QosQueryParameterBase)5 DataCenter (org.ovirt.engine.api.model.DataCenter)3 Qos (org.ovirt.engine.api.model.Qos)3 ArrayList (java.util.ArrayList)1 List (java.util.List)1 HostNetworkQos (org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)1 NetworkQoS (org.ovirt.engine.core.common.businessentities.network.NetworkQoS)1 CpuQos (org.ovirt.engine.core.common.businessentities.qos.CpuQos)1 StorageQos (org.ovirt.engine.core.common.businessentities.qos.StorageQos)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1