GlobalLoadBalancerRuleVO gslbRuleWithDomainName = _gslbRuleDao.findByDomainName(domainName);
if (gslbRuleWithDomainName != null) {
throw new InvalidParameterValueException("Domain name " + domainName + "is in use");
}
Region region = _regionDao.findById(regionId);
if (region == null) {
throw new InvalidParameterValueException("Invalid region ID: " + regionId);
}
String providerDnsName = _globalConfigDao.getValue(Config.CloudDnsName.key());
if (!region.checkIfServiceEnabled(Region.Service.Gslb) || (providerDnsName == null)) {
throw new CloudRuntimeException("GSLB service is not enabled in region : " + region.getName());
}
GlobalLoadBalancerRuleVO newGslbRule = Transaction.execute(new TransactionCallback<GlobalLoadBalancerRuleVO>() {
@Override
public GlobalLoadBalancerRuleVO doInTransaction(TransactionStatus status) {