use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class NfsStorageModel method validate.
@Override
public boolean validate() {
getPath().validateEntity(new IValidation[] { new NotEmptyValidation(), new LinuxMountPointValidation(), new NonUtfValidation(), new NoSpacesValidation() });
if (getRetransmissions().getIsValid()) {
getRetransmissions().validateEntity(new IValidation[] { new IntegerValidation(0, RETRANS_MAX) });
}
if (getTimeout().getIsValid()) {
getTimeout().validateEntity(new IValidation[] { new IntegerValidation(1, TIMEOUT_MAX) });
}
getMountOptions().validateEntity(new IValidation[] { new NonUtfValidation() });
return getPath().getIsValid() && getRetransmissions().getIsValid() && getTimeout().getIsValid() && getMountOptions().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation 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();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class VmwarePropertiesModel method validate.
public boolean validate() {
if (!getIsAvailable()) {
setIsValid(true);
} else {
getvCenter().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new HostAddressValidation() });
getEsx().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new HostAddressValidation() });
vmwareDatacenter.validateEntity(new IValidation[] { new NotEmptyValidation() });
setIsValid(getvCenter().getIsValid() && getEsx().getIsValid() && getVmwareDatacenter().getIsValid());
}
return getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class ProfileBaseModel method validate.
public boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new SpecialAsciiI18NOrNoneValidation() });
getDescription().validateEntity(new IValidation[] { new AsciiOrNoneValidation() });
return getName().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class ExternalSubnetModel method validate.
public boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new AsciiNameValidation() });
boolean ipv4 = getIpVersion().getSelectedItem() == IpVersion.IPV4;
getCidr().validateEntity(new IValidation[] { ipv4 ? new CidrValidation() : new NotEmptyValidation() });
getIpVersion().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
getGateway().setIsValid(true);
if (StringHelper.isNotNullOrEmpty(getGateway().getEntity()) && ipv4) {
getGateway().validateEntity(new IValidation[] { new Ipv4AddressValidation() });
}
boolean dnsServersValid = true;
for (EntityModel<String> dnsServer : getDnsServers().getItems()) {
dnsServer.setIsValid(true);
if (StringHelper.isNotNullOrEmpty(dnsServer.getEntity()) && ipv4) {
dnsServer.validateEntity(new IValidation[] { new Ipv4AddressValidation() });
}
dnsServersValid &= dnsServer.getIsValid();
}
return getName().getIsValid() && getCidr().getIsValid() && getIpVersion().getIsValid() && getGateway().getIsValid() && dnsServersValid;
}
Aggregations