use of org.ovirt.engine.ui.uicommonweb.validation.UrlValidation in project ovirt-engine by oVirt.
the class ProviderModel method validateConnectionSettings.
private boolean validateConnectionSettings() {
getUsername().validateEntity(new IValidation[] { new NotEmptyValidation() });
getPassword().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(200) });
if (getType().getSelectedItem().isTenantRequired()) {
getTenantName().validateEntity(new IValidation[] { new NotEmptyValidation() });
}
getAuthUrl().validateEntity(new IValidation[] { new NotEmptyValidation(), new UrlValidation(Uri.SCHEME_HTTP, Uri.SCHEME_HTTPS) });
getUrl().validateEntity(new IValidation[] { new NotEmptyValidation(), new UrlValidation(Uri.SCHEME_HTTP, Uri.SCHEME_HTTPS) });
return (getUrl().getEntity() == null || getUrl().getIsValid() || getUrl().getEntity().isEmpty()) && getUsername().getIsValid() && getPassword().getIsValid() && getTenantName().getIsValid() && getAuthUrl().getIsValid();
}
Aggregations