Search in sources :

Example 41 with NotEmptyValidation

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

the class SanStorageModelBase method validateDiscoverTargetFields.

private boolean validateDiscoverTargetFields() {
    getContainer().getHost().validateSelectedItem(new NotEmptyValidation[] { new NotEmptyValidation() });
    getAddress().validateEntity(new IValidation[] { new NotEmptyValidation() });
    IntegerValidation tempVar = new IntegerValidation();
    tempVar.setMinimum(0);
    tempVar.setMaximum(65535);
    getPort().validateEntity(new IValidation[] { new NotEmptyValidation(), tempVar });
    if (getUseUserAuth().getEntity()) {
        getUserName().validateEntity(new IValidation[] { new NotEmptyValidation() });
        getPassword().validateEntity(new IValidation[] { new NotEmptyValidation() });
    }
    return getContainer().getHost().getIsValid() && getAddress().getIsValid() && getPort().getIsValid() && getUserName().getIsValid() && getPassword().getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) IntegerValidation(org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)

Example 42 with NotEmptyValidation

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

the class StorageDRModel method validate.

public boolean validate() {
    getGeoRepSession().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
    getFrequency().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
    getHour().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, MAX_HOUR) });
    getMins().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, MAX_MINUTE) });
    boolean ret = getGeoRepSession().getIsValid() && getFrequency().getIsValid();
    if (!getFrequency().getSelectedItem().equals(Frequency.NONE)) {
        return ret && getHour().getIsValid() && getMins().getIsValid();
    }
    return ret;
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) IntegerValidation(org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)

Example 43 with NotEmptyValidation

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

the class XENPropertiesModel method validate.

public boolean validate() {
    if (!getIsAvailable()) {
        setIsValid(true);
    } else {
        getUrl().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255) });
        setIsValid(getUrl().getIsValid());
    }
    return getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Example 44 with NotEmptyValidation

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

the class EditQuotaStorageModel method validate.

public boolean validate() {
    LongValidation longValidation = new LongValidation(1, 65535);
    getSpecificStorageValue().setIsValid(true);
    if (getSpecificStorage().getEntity()) {
        getSpecificStorageValue().validateEntity(new IValidation[] { longValidation, new NotEmptyValidation() });
    }
    return getSpecificStorageValue().getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LongValidation(org.ovirt.engine.ui.uicommonweb.validation.LongValidation)

Example 45 with NotEmptyValidation

use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation 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();
}
Also used : IValidation(org.ovirt.engine.ui.uicommonweb.validation.IValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation) IntegerValidation(org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)

Aggregations

NotEmptyValidation (org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation)66 LengthValidation (org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)31 IntegerValidation (org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)21 AsciiNameValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation)11 SpecialAsciiI18NOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.SpecialAsciiI18NOrNoneValidation)9 HostAddressValidation (org.ovirt.engine.ui.uicommonweb.validation.HostAddressValidation)7 IValidation (org.ovirt.engine.ui.uicommonweb.validation.IValidation)7 AsciiOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation)6 RegexValidation (org.ovirt.engine.ui.uicommonweb.validation.RegexValidation)6 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)4 StorageType (org.ovirt.engine.core.common.businessentities.storage.StorageType)4 I18NNameValidation (org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation)4 ArrayList (java.util.ArrayList)3 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)3 Arrays (java.util.Arrays)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Set (java.util.Set)2 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)2 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)2