Search in sources :

Example 1 with UrlValidation

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();
}
Also used : UrlValidation(org.ovirt.engine.ui.uicommonweb.validation.UrlValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Aggregations

LengthValidation (org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)1 NotEmptyValidation (org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation)1 UrlValidation (org.ovirt.engine.ui.uicommonweb.validation.UrlValidation)1