use of org.ovirt.engine.core.common.businessentities.network.NetworkQoS in project ovirt-engine by oVirt.
the class EditNetworkQoSModel method executeSave.
@Override
public void executeSave() {
QosParametersBase<NetworkQoS> parameters = new QosParametersBase<>();
parameters.setQos(networkQoS);
Frontend.getInstance().runAction(ActionType.UpdateNetworkQoS, parameters, result -> {
ActionReturnValue retVal = result.getReturnValue();
boolean succeeded = false;
if (retVal != null && retVal.getSucceeded()) {
succeeded = true;
}
postSaveAction(succeeded);
});
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkQoS in project ovirt-engine by oVirt.
the class RemoveNetworkQoSModel method onRemove.
public void onRemove() {
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (Object networkQoS : sourceListModel.getSelectedItems()) {
QosParametersBase<NetworkQoS> parameter = new QosParametersBase<>();
NetworkQoS tempQos = (NetworkQoS) networkQoS;
parameter.setQos(tempQos);
parameters.add(parameter);
}
Frontend.getInstance().runMultipleAction(ActionType.RemoveNetworkQoS, parameters);
cancel();
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkQoS in project ovirt-engine by oVirt.
the class RemoveNetworkQoSModel method setMessage.
private void setMessage() {
ArrayList<QueryParametersBase> parameters = new ArrayList<>();
ArrayList<QueryType> queryTypes = new ArrayList<>();
for (Object networkQoS : sourceListModel.getSelectedItems()) {
QueryParametersBase parameter = new IdQueryParameters(((NetworkQoS) networkQoS).getId());
parameters.add(parameter);
queryTypes.add(QueryType.GetVnicProfilesByNetworkQosId);
}
Frontend.getInstance().runMultipleQueries(queryTypes, parameters, result -> {
ArrayList<VnicProfileView> vnicProfiles = new ArrayList<>();
setHelpTag(HelpTag.remove_network_qos);
// $NON-NLS-1$
setHashName("remove_network_qos");
for (QueryReturnValue returnValue : result.getReturnValues()) {
vnicProfiles.addAll((ArrayList<VnicProfileView>) returnValue.getReturnValue());
}
if (vnicProfiles.isEmpty()) {
ArrayList<String> list = new ArrayList<>();
for (Object item : sourceListModel.getSelectedItems()) {
NetworkQoS i = (NetworkQoS) item;
list.add(i.getName());
}
setItems(list);
} else {
setMessage(ConstantsManager.getInstance().getMessages().removeNetworkQoSMessage(vnicProfiles.size()));
ArrayList<String> list = new ArrayList<>();
for (VnicProfileView item : vnicProfiles) {
list.add(item.getName());
}
setItems(list);
}
});
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkQoS in project ovirt-engine by oVirt.
the class QosRangeValidatorTest method validNetworkQosMessages.
@Test
public void validNetworkQosMessages() {
NetworkQoS qos = new NetworkQoS();
qos.setInboundAverage(OUT_OF_RANGE);
qos.setInboundPeak(OUT_OF_RANGE);
qos.setInboundBurst(OUT_OF_RANGE);
qos.setOutboundAverage(OUT_OF_RANGE);
qos.setOutboundPeak(OUT_OF_RANGE);
qos.setOutboundBurst(OUT_OF_RANGE);
List<String> validationMessages = ValidationUtils.validateInputs(Arrays.asList(new Class<?>[] { Default.class }), qos);
assertValidateMsgCount(validationMessages, "$range 0-100", 6);
assertValidateMsgCount(validationMessages, EngineMessage.ACTION_TYPE_FAILED_QOS_OUT_OF_RANGE_VALUES.name(), 6);
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkQoS in project ovirt-engine by oVirt.
the class NetworkQosDaoTest method testRemoveNetworkQos.
/**
* test remove
*/
@Test
public void testRemoveNetworkQos() {
dao.remove(qosCId);
NetworkQoS afterRemove = dao.get(qosCId);
assertNull(afterRemove);
}
Aggregations