private boolean checkIfHostIsDedicated(HostVO host) { long hostId = host.getId(); DedicatedResourceVO dedicatedHost = _dedicatedDao.findByHostId(hostId); DedicatedResourceVO dedicatedClusterOfHost = _dedicatedDao.findByClusterId(host.getClusterId()); DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId()); if (dedicatedHost != null || dedicatedClusterOfHost != null || dedicatedPodOfHost != null) { return true; } else { return false; } }
private Long accountOfDedicatedHost(HostVO host) { long hostId = host.getId(); DedicatedResourceVO dedicatedHost = _dedicatedDao.findByHostId(hostId); DedicatedResourceVO dedicatedClusterOfHost = _dedicatedDao.findByClusterId(host.getClusterId()); DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId()); if (dedicatedHost != null) { return dedicatedHost.getAccountId(); } if (dedicatedClusterOfHost != null) { return dedicatedClusterOfHost.getAccountId(); } if (dedicatedPodOfHost != null) { return dedicatedPodOfHost.getAccountId(); } return null; }
private Long domainOfDedicatedHost(HostVO host) { long hostId = host.getId(); DedicatedResourceVO dedicatedHost = _dedicatedDao.findByHostId(hostId); DedicatedResourceVO dedicatedClusterOfHost = _dedicatedDao.findByClusterId(host.getClusterId()); DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId()); if (dedicatedHost != null) { return dedicatedHost.getDomainId(); } if (dedicatedClusterOfHost != null) { return dedicatedClusterOfHost.getDomainId(); } if (dedicatedPodOfHost != null) { return dedicatedPodOfHost.getDomainId(); } return null; }
final DedicatedResourceVO dr = _dedicatedDao.findByPodId(podId); if (dr != null) { _dedicatedDao.remove(dr.getId());
resource = _dedicatedDao.findByPodId(podId);
} else { DedicatedResourceVO dedicatedCluster = _dedicatedDao.findByClusterId(clusterId); DedicatedResourceVO dedicatedPodOfCluster = _dedicatedDao.findByPodId(cluster.getPodId()); DedicatedResourceVO dedicatedZoneOfCluster = _dedicatedDao.findByZoneId(cluster.getDataCenterId());
throw new InvalidParameterValueException("Unable to find pod by id " + podId); } else { DedicatedResourceVO dedicatedPod = _dedicatedDao.findByPodId(podId); DedicatedResourceVO dedicatedZoneOfPod = _dedicatedDao.findByZoneId(pod.getDataCenterId());
List<DedicatedResourceVO> hostsToRelease = new ArrayList<DedicatedResourceVO>(); for (HostPodVO pod : pods) { DedicatedResourceVO dPod = _dedicatedDao.findByPodId(pod.getId()); if (dPod != null) { if (!(childDomainIds.contains(dPod.getDomainId()))) {
DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId()); DedicatedResourceVO dedicatedZoneOfHost = _dedicatedDao.findByZoneId(host.getDataCenterId());
DedicatedResourceVO dPod = _dedicatedDao.findByPodId(pod.getId()); if (dPod != null && !dedicatedResources.contains(dPod)) { avoidList.addPod(pod.getId());