Search in sources :

Example 6 with HostAddressValidation

use of org.ovirt.engine.ui.uicommonweb.validation.HostAddressValidation 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();
}
Also used : InterfaceMappingsValidation(org.ovirt.engine.ui.uicommonweb.validation.InterfaceMappingsValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) HostAddressValidation(org.ovirt.engine.ui.uicommonweb.validation.HostAddressValidation) IntegerValidation(org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)

Example 7 with HostAddressValidation

use of org.ovirt.engine.ui.uicommonweb.validation.HostAddressValidation in project ovirt-engine by oVirt.

the class ImportVmsModel method validateVmwareConfiguration.

private boolean validateVmwareConfiguration() {
    getvCenter().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new HostAddressValidation() });
    getEsx().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new HostAddressValidation() });
    getVmwareDatacenter().validateEntity(new IValidation[] { new NotEmptyValidation() });
    getUsername().validateEntity(new IValidation[] { new NotEmptyValidation(), new NameAndOptionalDomainValidation() });
    getPassword().validateEntity(new IValidation[] { new NotEmptyValidation() });
    return getvCenter().getIsValid() && getEsx().getIsValid() && getVmwareDatacenter().getIsValid() && getUsername().getIsValid() && getPassword().getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) HostAddressValidation(org.ovirt.engine.ui.uicommonweb.validation.HostAddressValidation) NameAndOptionalDomainValidation(org.ovirt.engine.ui.uicommonweb.validation.NameAndOptionalDomainValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Aggregations

HostAddressValidation (org.ovirt.engine.ui.uicommonweb.validation.HostAddressValidation)7 NotEmptyValidation (org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation)7 LengthValidation (org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)6 IntegerValidation (org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)4 HostnameValidation (org.ovirt.engine.ui.uicommonweb.validation.HostnameValidation)2 Map (java.util.Map)1 SortedMap (java.util.SortedMap)1 TreeMap (java.util.TreeMap)1 VmInitNetwork (org.ovirt.engine.core.common.businessentities.VmInitNetwork)1 IValidation (org.ovirt.engine.ui.uicommonweb.validation.IValidation)1 InterfaceMappingsValidation (org.ovirt.engine.ui.uicommonweb.validation.InterfaceMappingsValidation)1 IpAddressValidation (org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidation)1 Ipv4AddressValidation (org.ovirt.engine.ui.uicommonweb.validation.Ipv4AddressValidation)1 Ipv6AddressValidation (org.ovirt.engine.ui.uicommonweb.validation.Ipv6AddressValidation)1 MatchFieldsValidator (org.ovirt.engine.ui.uicommonweb.validation.MatchFieldsValidator)1 NameAndOptionalDomainValidation (org.ovirt.engine.ui.uicommonweb.validation.NameAndOptionalDomainValidation)1 SpecialAsciiI18NOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.SpecialAsciiI18NOrNoneValidation)1 SubnetMaskValidation (org.ovirt.engine.ui.uicommonweb.validation.SubnetMaskValidation)1 VmInitNetworkNameValidation (org.ovirt.engine.ui.uicommonweb.validation.VmInitNetworkNameValidation)1