use of org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation in project ovirt-engine by oVirt.
the class CpuQosParametersModel method validate.
@Override
public boolean validate() {
if (!getIsAvailable()) {
return true;
}
getCpuLimit().validateEntity(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.MaxCpuLimitQosValue)) });
setIsValid(getCpuLimit().getIsValid());
return getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation in project ovirt-engine by oVirt.
the class NewDiskModel method validate.
@Override
public boolean validate() {
if (getDiskStorageType().getEntity() == DiskStorageType.LUN && getSanStorageModelBase() != null) {
getSanStorageModelBase().validate();
if (!getSanStorageModelBase().getIsValid()) {
return false;
}
ArrayList<String> partOfSdLunsMessages = getSanStorageModelBase().getPartOfSdLunsMessages();
if (!partOfSdLunsMessages.isEmpty() && !getSanStorageModelBase().isForce()) {
forceCreationWarning(partOfSdLunsMessages);
return false;
}
}
StorageType storageType = getStorageDomain().getSelectedItem() == null ? StorageType.UNKNOWN : getStorageDomain().getSelectedItem().getStorageType();
IntegerValidation sizeValidation = new IntegerValidation();
sizeValidation.setMinimum(getMinimumDiskSize());
if (storageType.isBlockDomain()) {
sizeValidation.setMaximum((Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.MaxBlockDiskSize));
}
getSize().validateEntity(new IValidation[] { new NotEmptyValidation(), sizeValidation });
getStorageDomain().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
return super.validate() && getSize().getIsValid() && getStorageDomain().getIsValid();
}
Aggregations