use of org.ovirt.engine.ui.uicommonweb.validation.IValidation in project ovirt-engine by oVirt.
the class HostNetworkQosParametersModel method getOutLinkshareValidations.
protected Collection<IValidation> getOutLinkshareValidations() {
Collection<IValidation> validations = new ArrayList<>();
validations.add(new IntegerValidation(1, (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.MaxHostNetworkQosShares)));
return validations;
}
use of org.ovirt.engine.ui.uicommonweb.validation.IValidation in project ovirt-engine by oVirt.
the class QuotaModel method validate.
public boolean validate() {
LengthValidation lenValidation = new LengthValidation();
lenValidation.setMaxLength(60);
getName().setIsValid(true);
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), lenValidation });
IValidation[] graceValidationArr = new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, Integer.MAX_VALUE) };
IValidation[] thresholdValidationArr = new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, 100) };
getGraceCluster().validateEntity(graceValidationArr);
getGraceStorage().validateEntity(graceValidationArr);
getThresholdCluster().validateEntity(thresholdValidationArr);
getThresholdStorage().validateEntity(thresholdValidationArr);
boolean graceThreshold = getGraceCluster().getIsValid() & getGraceStorage().getIsValid() & getThresholdCluster().getIsValid() & getThresholdStorage().getIsValid();
return getName().getIsValid() & graceThreshold & validateNotEmpty();
}
use of org.ovirt.engine.ui.uicommonweb.validation.IValidation in project ovirt-engine by oVirt.
the class LibvirtSecretModel method validate.
public boolean validate() {
getUsageType().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
getUuid().validateEntity(new IValidation[] { new NotEmptyValidation(), new GuidValidation() });
ArrayList<IValidation> valueValidations = new ArrayList<>(Collections.singletonList(new RegexValidation(ValidationUtils.BASE_64_PATTERN, ConstantsManager.getInstance().getConstants().secretValueMustBeInBase64())));
if (isNew()) {
valueValidations.add(new NotEmptyValidation());
getValue().validateEntity(valueValidations.toArray(new IValidation[valueValidations.size()]));
}
return getUsageType().getIsValid() && getUuid().getIsValid() && getValue().getIsValid();
}
Aggregations