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()));
}
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;
}
}
Aggregations