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();
}
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;
}
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();
}
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();
}
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();
}
Aggregations