@Override @DB public boolean releaseDomainSpecificVirtualRanges(final long domainId) { final List<DomainVlanMapVO> maps = _domainVlanMapDao.listDomainVlanMapsByDomain(domainId); if (CollectionUtils.isNotEmpty(maps)) { try { Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(final TransactionStatus status) { for (DomainVlanMapVO map : maps) { if (!releasePublicIpRange(map.getVlanDbId(), _accountMgr.getSystemUser().getId(), _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM))) { throw new CloudRuntimeException("Failed to release domain specific virtual ip ranges for domain id=" + domainId); } } } }); } catch (final CloudRuntimeException e) { s_logger.error(e); return false; } } else { s_logger.trace("Domain id=" + domainId + " has no domain specific virtual ip ranges, nothing to release"); } return true; }
final List<DomainVlanMapVO> domainVln = _domainVlanMapDao.listDomainVlanMapsByVlan(vlanDbId); } else if (isDomainSpecific && _domainVlanMapDao.remove(domainVln.get(0).getId())) { s_logger.debug("Remove the vlan from domain_vlan_map successfully."); return true;
List<DomainVlanMapVO> domainmaps = _domainVlanMapDao.listDomainVlanMapsByVlan(vlanDbId); if (domainmaps != null && !domainmaps.isEmpty()) { throw new InvalidParameterValueException("Specified Public IP range has already been dedicated to a domain"); _domainVlanMapDao.persist(domainVlanMapVO);
@Override public Domain getVlanDomain(long vlanId) { Vlan vlan = _vlanDao.findById(vlanId); Long domainId = null; // if vlan is Virtual Domain specific, get vlan information from the // accountVlanMap; otherwise get account information // from the network if (vlan.getVlanType() == VlanType.VirtualNetwork) { List<DomainVlanMapVO> maps = _domainVlanMapDao.listDomainVlanMapsByVlan(vlanId); if (maps != null && !maps.isEmpty()) { return _domainDao.findById(maps.get(0).getDomainId()); } } return null; }
_domainVlanMapDao.persist(domainVlanMapVO); } else if (podId != null) {
ZoneWideNonDedicatedVlanSearch.join("AccountVlanMapSearch", AccountVlanMapSearch, ZoneWideNonDedicatedVlanSearch.entity().getId(), AccountVlanMapSearch.entity() .getVlanDbId(), JoinBuilder.JoinType.LEFTOUTER); DomainVlanMapSearch = _domainVlanMapDao.createSearchBuilder(); DomainVlanMapSearch.and("domainId", DomainVlanMapSearch.entity().getDomainId(), SearchCriteria.Op.NULL); ZoneWideNonDedicatedVlanSearch.join("DomainVlanMapSearch", DomainVlanMapSearch, ZoneWideNonDedicatedVlanSearch.entity().getId(), DomainVlanMapSearch.entity().getVlanDbId(), JoinBuilder.JoinType.LEFTOUTER);
List<DomainVlanMapVO> domainVln = _domainVlanMapDao.listDomainVlanMapsByVlan(vlanRange.getId());
List<DomainVlanMapVO> domainMaps = _domainVlanMapDao.listDomainVlanMapsByDomain(owner.getDomainId()); for (DomainVlanMapVO map : domainMaps) { if (vlanDbIds == null || vlanDbIds.contains(map.getVlanDbId()))