use of org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation 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.IntegerValidation 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.IntegerValidation in project ovirt-engine by oVirt.
the class NeutronAgentModel method validate.
public boolean validate() {
if (getIsAvailable()) {
getPluginType().validateSelectedItem(new IValidation[] { pluginValidator });
getBrokerType().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
getInterfaceMappings().validateEntity(new IValidation[] { new InterfaceMappingsValidation() });
getMessagingServer().validateEntity(new IValidation[] { new HostAddressValidation(true, true) });
getMessagingServerPort().validateEntity(new IValidation[] { new IntegerValidation(BusinessEntitiesDefinitions.NETWORK_MIN_LEGAL_PORT, BusinessEntitiesDefinitions.NETWORK_MAX_LEGAL_PORT) });
setIsValid(getPluginType().getIsValid() && getInterfaceMappings().getIsValid() && getMessagingServer().getIsValid() && getMessagingServerPort().getIsValid() && getBrokerType().getIsValid());
}
return getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation in project ovirt-engine by oVirt.
the class EditDiskModel method validate.
@Override
public boolean validate() {
StorageType storageType = getStorageDomain().getSelectedItem() == null ? StorageType.UNKNOWN : getStorageDomain().getSelectedItem().getStorageType();
IntegerValidation sizeValidation = new IntegerValidation();
if (storageType.isBlockDomain()) {
Integer maxBlockDiskSize = (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.MaxBlockDiskSize);
sizeValidation.setMaximum(maxBlockDiskSize - getSize().getEntity());
}
getSizeExtend().validateEntity(new IValidation[] { new NotEmptyValidation(), new NonNegativeLongNumberValidation(), sizeValidation });
return super.validate() && getSizeExtend().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation 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