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.findByClusterId(cluster.getId()); if (dr != null) { _dedicatedDao.remove(dr.getId());
resource = _dedicatedDao.findByClusterId(clusterId);
throw new InvalidParameterValueException("Unable to find cluster by id " + clusterId); } else { DedicatedResourceVO dedicatedCluster = _dedicatedDao.findByClusterId(clusterId); DedicatedResourceVO dedicatedPodOfCluster = _dedicatedDao.findByPodId(cluster.getPodId()); DedicatedResourceVO dedicatedZoneOfCluster = _dedicatedDao.findByZoneId(cluster.getDataCenterId());
DedicatedResourceVO dCluster = _dedicatedDao.findByClusterId(cluster.getId()); if (dCluster != null) { if (!(childDomainIds.contains(dCluster.getDomainId()))) {
List<DedicatedResourceVO> hostsToRelease = new ArrayList<DedicatedResourceVO>(); for (ClusterVO cluster : clusters) { DedicatedResourceVO dCluster = _dedicatedDao.findByClusterId(cluster.getId()); if (dCluster != null) { if (!(childDomainIds.contains(dCluster.getDomainId()))) {
DedicatedResourceVO dedicatedClusterOfHost = _dedicatedDao.findByClusterId(host.getClusterId()); DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId()); DedicatedResourceVO dedicatedZoneOfHost = _dedicatedDao.findByZoneId(host.getDataCenterId());
DedicatedResourceVO dCluster = _dedicatedDao.findByClusterId(cluster.getId()); if (dCluster != null && !dedicatedResources.contains(dCluster)) { avoidList.addCluster(cluster.getId()); DedicatedResourceVO dCluster = _dedicatedDao.findByClusterId(cluster.getId()); if (dCluster != null && !dedicatedResources.contains(dCluster)) { avoidList.addCluster(cluster.getId());