Search in sources :

Example 1 with SelectedQuotaValidation

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

the class MoveOrCopyDiskModel method validate.

public boolean validate() {
    boolean quotaValidated = true;
    if (getQuotaEnforcementType() == QuotaEnforcementTypeEnum.DISABLED || getQuotaEnforcementType() == QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT) {
        quotaValidated = false;
    }
    boolean isValid = true;
    for (DiskModel diskModel : getDisks()) {
        if (quotaValidated) {
            diskModel.getQuota().validateSelectedItem(new IValidation[] { new SelectedQuotaValidation() });
            isValid &= diskModel.getQuota().getIsValid();
        }
        diskModel.getAlias().validateEntity(new IValidation[] { new NotEmptyValidation(), new I18NNameValidation() });
        isValid &= diskModel.getAlias().getIsValid();
    }
    return isValid;
}
Also used : DiskModel(org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel) SelectedQuotaValidation(org.ovirt.engine.ui.uicommonweb.validation.SelectedQuotaValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) I18NNameValidation(org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation)

Aggregations

DiskModel (org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel)1 I18NNameValidation (org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation)1 NotEmptyValidation (org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation)1 SelectedQuotaValidation (org.ovirt.engine.ui.uicommonweb.validation.SelectedQuotaValidation)1