Search in sources :

Example 11 with AsciiNameValidation

use of org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation in project ovirt-engine by oVirt.

the class CreateBrickModel method validate.

public boolean validate() {
    getLvName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(50), new AsciiNameValidation() });
    if (!getLvName().getIsValid()) {
        return false;
    }
    getMountPoint().validateEntity(new IValidation[] { new NotEmptyValidation(), new BrickMountPointValidation() });
    if (!getMountPoint().getIsValid()) {
        return false;
    }
    IntegerValidation noOfPhysicalDiscsValidation = new IntegerValidation();
    noOfPhysicalDiscsValidation.setMinimum(1);
    getNoOfPhysicalDisksInRaidVolume().validateEntity(new IValidation[] { new NotEmptyValidation(), noOfPhysicalDiscsValidation });
    if (!getNoOfPhysicalDisksInRaidVolume().getIsValid()) {
        return false;
    }
    IntegerValidation stripSizeValidation = new IntegerValidation();
    stripSizeValidation.setMinimum(1);
    getStripeSize().validateEntity(new IValidation[] { new NotEmptyValidation(), stripSizeValidation });
    if (!getStripeSize().getIsValid()) {
        return false;
    }
    return true;
}
Also used : BrickMountPointValidation(org.ovirt.engine.ui.uicommonweb.validation.BrickMountPointValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) AsciiNameValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation) IntegerValidation(org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)

Example 12 with AsciiNameValidation

use of org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation in project ovirt-engine by oVirt.

the class NetworkQoSModel method validate.

@Override
public boolean validate() {
    super.validate();
    getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new AsciiNameValidation() });
    setIsValid(getIsValid() && getName().getIsValid());
    return getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) AsciiNameValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation)

Aggregations

AsciiNameValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation)12 NotEmptyValidation (org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation)11 LengthValidation (org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)6 AsciiOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation)3 IntegerValidation (org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)2 SpecialAsciiI18NOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.SpecialAsciiI18NOrNoneValidation)2 HashSet (java.util.HashSet)1 NewVnicProfileModel (org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel)1 VnicProfileModel (org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel)1 BrickMountPointValidation (org.ovirt.engine.ui.uicommonweb.validation.BrickMountPointValidation)1 CidrValidation (org.ovirt.engine.ui.uicommonweb.validation.CidrValidation)1 Ipv4AddressValidation (org.ovirt.engine.ui.uicommonweb.validation.Ipv4AddressValidation)1 RegexValidation (org.ovirt.engine.ui.uicommonweb.validation.RegexValidation)1