use of org.ovirt.engine.core.common.businessentities.network.NetworkQoS in project ovirt-engine by oVirt.
the class NetworkQosValidatorTest method nameNotChangedOrNotTakenTest.
private void nameNotChangedOrNotTakenTest(Matcher<ValidationResult> matcher) {
NetworkQoS otherQos = new NetworkQoS();
allQos.add(otherQos);
allQos.add(oldQos);
otherQos.setName("foo");
oldQos.setName("bar");
assertThat(validator.nameNotChangedOrNotTaken(), matcher);
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkQoS 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());
}
}
}
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkQoS in project ovirt-engine by oVirt.
the class NetworkQosMapper method deserialize.
public NetworkQoS deserialize() {
Map<String, Integer> inboundData = (Map<String, Integer>) map.get(inboundEntry);
Map<String, Integer> outboundData = (Map<String, Integer>) map.get(outboundEntry);
if (inboundData == null && outboundData == null) {
return null;
}
NetworkQoS qos = new NetworkQoS();
if (inboundData != null) {
qos.setInboundAverage(divide(inboundData.get(VdsProperties.QOS_AVERAGE), MEGABITS_TO_KILOBYTES));
qos.setInboundPeak(divide(inboundData.get(VdsProperties.QOS_PEAK), MEGABITS_TO_KILOBYTES));
qos.setInboundBurst(divide(inboundData.get(VdsProperties.QOS_BURST), MEGABYTES_TO_KILOBYTES));
}
if (outboundData != null) {
qos.setOutboundAverage(divide(outboundData.get(VdsProperties.QOS_AVERAGE), MEGABITS_TO_KILOBYTES));
qos.setOutboundPeak(divide(outboundData.get(VdsProperties.QOS_PEAK), MEGABITS_TO_KILOBYTES));
qos.setOutboundBurst(divide(outboundData.get(VdsProperties.QOS_BURST), MEGABYTES_TO_KILOBYTES));
}
return qos;
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkQoS 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.businessentities.network.NetworkQoS in project ovirt-engine by oVirt.
the class DataCenterNetworkQoSListModel method edit.
public void edit() {
final NetworkQoS networkQoS = getSelectedItem();
if (getWindow() != null) {
return;
}
final NetworkQoSModel networkQoSModel = new EditNetworkQoSModel(networkQoS, this, getEntity());
setWindow(networkQoSModel);
networkQoSModel.getDataCenters().setItems(Arrays.asList(getEntity()), getEntity());
}
Aggregations