Search in sources :

Example 1 with NetworkProviderValidator

use of org.ovirt.engine.core.bll.provider.NetworkProviderValidator in project ovirt-engine by oVirt.

the class ImportExternalNetworkCommand method validate.

@Override
protected boolean validate() {
    NetworkProviderValidator providerValidator = new NetworkProviderValidator(getProvider());
    NetworkValidator networkValidator = new NetworkValidator(null, getNetwork());
    return validate(providerValidator.providerIsSet()) && validate(providerValidator.providerTypeIsNetwork()) && validate(providerValidator.validateAuthentication()) && validate(networkValidator.networkIsSet(getParameters().getNetworkExternalId()));
}
Also used : NetworkValidator(org.ovirt.engine.core.bll.validator.NetworkValidator) NetworkProviderValidator(org.ovirt.engine.core.bll.provider.NetworkProviderValidator)

Example 2 with NetworkProviderValidator

use of org.ovirt.engine.core.bll.provider.NetworkProviderValidator in project ovirt-engine by oVirt.

the class VdsCommand method validateNetworkProviderConfiguration.

protected boolean validateNetworkProviderConfiguration(Guid providerId, String networkMappings) {
    if (providerId == null) {
        return true;
    } else {
        Provider provider = providerDao.get(providerId);
        NetworkProviderValidator validator = new NetworkProviderValidator(provider);
        if (!(validate(validator.providerIsSet()) && validate(validator.providerTypeIsNetwork()))) {
            return false;
        }
        if ((provider.getType() == ProviderType.OPENSTACK_NETWORK) && !validateOpenstackNetworkProviderProperties(validator, networkMappings)) {
            return false;
        }
        return true;
    }
}
Also used : NetworkProviderValidator(org.ovirt.engine.core.bll.provider.NetworkProviderValidator) Provider(org.ovirt.engine.core.common.businessentities.Provider)

Aggregations

NetworkProviderValidator (org.ovirt.engine.core.bll.provider.NetworkProviderValidator)2 NetworkValidator (org.ovirt.engine.core.bll.validator.NetworkValidator)1 Provider (org.ovirt.engine.core.common.businessentities.Provider)1