use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class LibvirtSecretModel method validate.
public boolean validate() {
getUsageType().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
getUuid().validateEntity(new IValidation[] { new NotEmptyValidation(), new GuidValidation() });
ArrayList<IValidation> valueValidations = new ArrayList<>(Collections.singletonList(new RegexValidation(ValidationUtils.BASE_64_PATTERN, ConstantsManager.getInstance().getConstants().secretValueMustBeInBase64())));
if (isNew()) {
valueValidations.add(new NotEmptyValidation());
getValue().validateEntity(valueValidations.toArray(new IValidation[valueValidations.size()]));
}
return getUsageType().getIsValid() && getUuid().getIsValid() && getValue().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class MoveOrCopyDiskModel method validate.
public boolean validate() {
boolean quotaValidated = true;
if (getQuotaEnforcementType() == QuotaEnforcementTypeEnum.DISABLED || getQuotaEnforcementType() == QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT) {
quotaValidated = false;
}
boolean isValid = true;
for (DiskModel diskModel : getDisks()) {
if (quotaValidated) {
diskModel.getQuota().validateSelectedItem(new IValidation[] { new SelectedQuotaValidation() });
isValid &= diskModel.getQuota().getIsValid();
}
diskModel.getAlias().validateEntity(new IValidation[] { new NotEmptyValidation(), new I18NNameValidation() });
isValid &= diskModel.getAlias().getIsValid();
}
return isValid;
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class PosixStorageModel method validate.
@Override
public boolean validate() {
getPath().validateEntity(new IValidation[] { new NotEmptyValidation() });
getVfsType().validateEntity(new IValidation[] { new NotEmptyValidation(), new AsciiNameValidation() });
return getPath().getIsValid() && getVfsType().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation 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.NotEmptyValidation in project ovirt-engine by oVirt.
the class ProviderModel method validate.
private boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new AsciiNameValidation() });
getType().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
getNeutronAgentModel().validate();
getVmwarePropertiesModel().validate();
getKvmPropertiesModel().validate();
getXenPropertiesModel().validate();
boolean connectionSettingsValid = validateConnectionSettings();
return connectionSettingsValid && getName().getIsValid() && getType().getIsValid() && getNeutronAgentModel().getIsValid() && getKvmPropertiesModel().getIsValid() && getXenPropertiesModel().getIsValid() && getVmwarePropertiesModel().getIsValid();
}
Aggregations