@Override public Boolean doInTransaction(final TransactionStatus status) { // delete vlans for this zone final List<VlanVO> vlans = _vlanDao.listByZone(zoneId); for (final VlanVO vlan : vlans) { _vlanDao.remove(vlan.getId()); } final boolean success = _zoneDao.remove(zoneId); if (success) { // delete all capacity records for the zone _capacityDao.removeBy(null, zoneId, null, null, null); // remove from dedicated resources final DedicatedResourceVO dr = _dedicatedDao.findByZoneId(zoneId); if (dr != null) { _dedicatedDao.remove(dr.getId()); // find the group associated and check if there are any more // resources under that group final List<DedicatedResourceVO> resourcesInGroup = _dedicatedDao.listByAffinityGroupId(dr.getAffinityGroupId()); if (resourcesInGroup.isEmpty()) { // delete the group _affinityGroupService.deleteAffinityGroup(dr.getAffinityGroupId(), null, null, null, null); } } } return success; } });
DedicatedResourceVO dedicatedZone = _dedicatedDao.findByZoneId(dc.getId()); if (dedicatedZone != null && !_accountMgr.isRootAdmin(vmProfile.getOwner().getId())) { long accountDomainId = vmProfile.getOwner().getDomainId();
DedicatedResourceVO resource = null; if (zoneId != null) { resource = _dedicatedDao.findByZoneId(zoneId);
DedicatedResourceVO dedicatedCluster = _dedicatedDao.findByClusterId(clusterId); DedicatedResourceVO dedicatedPodOfCluster = _dedicatedDao.findByPodId(cluster.getPodId()); DedicatedResourceVO dedicatedZoneOfCluster = _dedicatedDao.findByZoneId(cluster.getDataCenterId());
} else { DedicatedResourceVO dedicatedPod = _dedicatedDao.findByPodId(podId); DedicatedResourceVO dedicatedZoneOfPod = _dedicatedDao.findByZoneId(pod.getDataCenterId());
throw new InvalidParameterValueException("Unable to find zone by id " + zoneId); } else { DedicatedResourceVO dedicatedZone = _dedicatedDao.findByZoneId(zoneId);
DedicatedResourceVO dedicatedClusterOfHost = _dedicatedDao.findByClusterId(host.getClusterId()); DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId()); DedicatedResourceVO dedicatedZoneOfHost = _dedicatedDao.findByZoneId(host.getDataCenterId());
final DedicatedResourceVO resource = _dedicatedDao.findByZoneId(zoneId); Long resourceId = null; if (resource != null) {
DedicatedResourceVO dedicatedZone = _dedicatedDao.findByZoneId(zone.getId()); if (dedicatedZone != null) { DomainVO domain = _domainDao.findById(dedicatedZone.getDomainId());
DedicatedResourceVO dedicatedZone = _dedicatedDao.findByZoneId(zone.getId()); if (dedicatedZone != null) { if (dedicatedZone.getAccountId() != null) {