use of org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation in project ovirt-engine by oVirt.
the class StorageModel method validate.
public boolean validate() {
validateListItems(getHost());
validateListItems(getAvailableStorageDomainTypeItems());
validateListItems(getAvailableStorageTypeItems());
getDescription().validateEntity(new IValidation[] { new LengthValidation(BusinessEntitiesDefinitions.GENERAL_MAX_SIZE), new SpecialAsciiI18NOrNoneValidation() });
getComment().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation() });
getWarningLowSpaceIndicator().validateEntity(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, StorageConstants.LOW_SPACE_THRESHOLD) });
getCriticalSpaceActionBlocker().validateEntity(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, Integer.MAX_VALUE) });
validateDiscardAfterDelete();
return getName().getIsValid() && getHost().getIsValid() && getIsValid() && getCurrentStorageItem().validate() && getDescription().getIsValid() && getComment().getIsValid() && getWarningLowSpaceIndicator().getIsValid() && getCriticalSpaceActionBlocker().getIsValid() && getDiscardAfterDelete().getIsValid() && getBackup().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation in project ovirt-engine by oVirt.
the class NetworkModel method validate.
private boolean validate() {
LengthValidation tempVar = new LengthValidation();
tempVar.setMaxLength(BusinessEntitiesDefinitions.NETWORK_NAME_SIZE);
RegexValidation tempVar2 = new RegexValidation();
tempVar2.setIsNegate(true);
// $NON-NLS-1$
tempVar2.setExpression("^(bond)");
tempVar2.setMessage(ConstantsManager.getInstance().getConstants().networkNameStartMsg());
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), tempVar, tempVar2 });
LengthValidation tempVar3 = new LengthValidation();
tempVar3.setMaxLength(40);
getDescription().validateEntity(new IValidation[] { tempVar3 });
getComment().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation() });
getVLanTag().setIsValid(true);
if (getHasVLanTag().getEntity()) {
IntegerValidation tempVar4 = new IntegerValidation();
tempVar4.setMinimum(0);
tempVar4.setMaximum(4094);
getVLanTag().validateEntity(new IValidation[] { new NotEmptyValidation(), tempVar4 });
}
IntegerValidation tempVar5 = new IntegerValidation();
tempVar5.setMinimum(68);
getMtu().validateEntity(new IValidation[] { new NotEmptyValidation(), tempVar5 });
getDnsConfigurationModel().validate();
getExternalProviders().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
boolean subnetValid = true;
if (getExternal().getEntity() && getCreateSubnet().getEntity()) {
subnetValid = getSubnetModel().validate();
}
boolean profilesValid = true;
Iterable<VnicProfileModel> profiles = getProfiles().getItems();
for (VnicProfileModel profileModel : profiles) {
if (!profileModel.validate()) {
profilesValid = false;
}
}
getNetworkLabel().validateSelectedItem(new IValidation[] { new AsciiNameValidation() });
setValidTab(TabName.GENERAL_TAB, isGeneralTabValid());
setValidTab(TabName.SUBNET_TAB, subnetValid);
setValidTab(TabName.PROFILES_TAB, profilesValid);
ValidationCompleteEvent.fire(getEventBus(), this);
return allTabsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation in project ovirt-engine by oVirt.
the class VolumeBrickModel method validate.
public boolean validate() {
getReplicaCount().setIsValid(true);
getStripeCount().setIsValid(true);
if (getReplicaCount().getIsAvailable()) {
IntegerValidation replicaCountValidation = new IntegerValidation();
replicaCountValidation.setMinimum(2);
replicaCountValidation.setMaximum(16);
getReplicaCount().validateEntity(new IValidation[] { new NotEmptyValidation(), replicaCountValidation });
}
if (getStripeCount().getIsAvailable()) {
IntegerValidation stripeCountValidation = new IntegerValidation();
stripeCountValidation.setMinimum(4);
stripeCountValidation.setMaximum(16);
getStripeCount().validateEntity(new IValidation[] { new NotEmptyValidation(), stripeCountValidation });
}
return getReplicaCount().getIsValid() && getStripeCount().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation in project ovirt-engine by oVirt.
the class NetworkQosParametersModel method validate.
public boolean validate() {
if (!getEnabled().getEntity()) {
return true;
}
getAverage().validateEntity(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.MaxAverageNetworkQoSValue)) });
getPeak().validateEntity(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.MaxPeakNetworkQoSValue)) });
getBurst().validateEntity(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.MaxBurstNetworkQoSValue)) });
setIsValid(getAverage().getIsValid() && getPeak().getIsValid() && getBurst().getIsValid());
return getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation in project ovirt-engine by oVirt.
the class HostNetworkQosParametersModel method getOutLinkshareValidations.
protected Collection<IValidation> getOutLinkshareValidations() {
Collection<IValidation> validations = new ArrayList<>();
validations.add(new IntegerValidation(1, (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.MaxHostNetworkQosShares)));
return validations;
}
Aggregations