Search in sources :

Example 16 with StorageQos

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);
}
Also used : StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos) Default(javax.validation.groups.Default) Test(org.junit.Test)

Example 17 with StorageQos

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());
}
Also used : StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) DiskProfile(org.ovirt.engine.core.common.businessentities.profiles.DiskProfile)

Aggregations

StorageQos (org.ovirt.engine.core.common.businessentities.qos.StorageQos)17 Map (java.util.Map)4 Test (org.junit.Test)4 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)4 Guid (org.ovirt.engine.core.compat.Guid)4 HashMap (java.util.HashMap)3 List (java.util.List)3 VmSlaPolicyParameters (org.ovirt.engine.core.common.action.VmSlaPolicyParameters)2 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 Set (java.util.Set)1 Callable (java.util.concurrent.Callable)1 Collectors (java.util.stream.Collectors)1 Observes (javax.enterprise.event.Observes)1 Instance (javax.enterprise.inject.Instance)1 Inject (javax.inject.Inject)1