Search in sources :

Example 1 with BrickMountPointValidation

use of org.ovirt.engine.ui.uicommonweb.validation.BrickMountPointValidation 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)

Aggregations

AsciiNameValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation)1 BrickMountPointValidation (org.ovirt.engine.ui.uicommonweb.validation.BrickMountPointValidation)1 IntegerValidation (org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)1 LengthValidation (org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)1 NotEmptyValidation (org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation)1