use of org.ovirt.engine.core.common.businessentities.qos.StorageQos in project ovirt-engine by oVirt.
the class QosRangeValidatorTest method validStorageMessage.
@Test
public void validStorageMessage() {
StorageQos qos = new StorageQos();
qos.setMaxThroughput(OUT_OF_RANGE);
qos.setMaxReadThroughput(OUT_OF_RANGE);
qos.setMaxWriteThroughput(OUT_OF_RANGE);
qos.setMaxIops(OUT_OF_RANGE);
qos.setMaxReadIops(OUT_OF_RANGE);
qos.setMaxWriteIops(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.qos.StorageQos in project ovirt-engine by oVirt.
the class DiskProfilesListModelTable method initTable.
@Override
public void initTable() {
getTable().enableColumnResizing();
AbstractTextColumn<DiskProfile> nameColumn = new AbstractTextColumn<DiskProfile>() {
@Override
public String getValue(DiskProfile object) {
return object.getName();
}
};
// $NON-NLS-1$
getTable().addColumn(nameColumn, constants.profileNameLabel(), "200px");
nameColumn.makeSortable();
AbstractTextColumn<DiskProfile> descriptionColumn = new AbstractTextColumn<DiskProfile>() {
@Override
public String getValue(DiskProfile object) {
return object.getDescription();
}
};
// $NON-NLS-1$
getTable().addColumn(descriptionColumn, constants.profileDescriptionLabel(), "200px");
descriptionColumn.makeSortable();
AbstractTextColumn<DiskProfile> qosColumn = new AbstractTextColumn<DiskProfile>() {
@Override
public String getValue(DiskProfile object) {
String name = constants.unlimitedQos();
if (object.getQosId() != null) {
StorageQos storageQos = getModel().getQos(object.getQosId());
if (storageQos != null) {
name = storageQos.getName();
}
}
return name;
}
};
// $NON-NLS-1$
getTable().addColumn(qosColumn, constants.qosName(), "200px");
qosColumn.makeSortable();
// Add selection listener
getModel().getSelectedItemChangedEvent().addListener((ev, sender, args) -> updatePermissionPanel());
getModel().getItemsChangedEvent().addListener((ev, sender, args) -> updatePermissionPanel());
}
Aggregations