use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation 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();
}
use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.
the class DataCenterModel method validate.
public boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(40), new LengthValidation(getMaxNameLength()), new AsciiNameValidation() });
getVersion().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
getDescription().validateEntity(new IValidation[] { new AsciiOrNoneValidation() });
getComment().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation() });
boolean validationResult = getName().getIsValid() && getDescription().getIsValid() && getComment().getIsValid() && getVersion().getIsValid();
return validationResult;
}
use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.
the class IscsiBondModel method validate.
private boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new I18NNameValidation(), new LengthValidation(50) });
getDescription().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation(), new LengthValidation(4000) });
if (getNetworks().getSelectedItems() == null || getNetworks().getSelectedItems().isEmpty()) {
getInvalidityReasons().add(constants.noNetworksSelected());
setIsValid(false);
} else {
setIsValid(true);
}
return getName().getIsValid() && getDescription().getIsValid() && getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.
the class VolumeModel method validate.
public boolean validate() {
if (!validateBrickCount()) {
setMessage(VolumeBrickModel.getValidationFailedMsg(getTypeList().getSelectedItem(), true));
return false;
}
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(50), new AsciiNameValidation() });
setMessage(null);
boolean validTransportTypes = true;
if (!getTcpTransportType().getEntity() && !getRdmaTransportType().getEntity()) {
validTransportTypes = false;
setMessage(ConstantsManager.getInstance().getConstants().volumeTransportTypesValidationMsg());
}
return getName().getIsValid() && validTransportTypes;
}
use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation 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;
}
Aggregations