public static String findClusterDetails(long clusterId, String name) { ClusterDetailsVO detailsVO = s_clusterDetailsDao.findDetail(clusterId, name); if (detailsVO != null) { return detailsVO.getValue(); } return null; }
@Override public AllocationState findClusterAllocationState(final ClusterVO cluster) { if (cluster.getAllocationState() == AllocationState.Disabled) { return AllocationState.Disabled; } else if (ApiDBUtils.findPodById(cluster.getPodId()).getAllocationState() == AllocationState.Disabled) { return AllocationState.Disabled; } else { final DataCenterVO zone = ApiDBUtils.findZoneById(cluster.getDataCenterId()); return zone.getAllocationState(); } }
@Override public AllocationState findPodAllocationState(final HostPodVO pod) { if (pod.getAllocationState() == AllocationState.Disabled) { return AllocationState.Disabled; } else { final DataCenterVO zone = ApiDBUtils.findZoneById(pod.getDataCenterId()); return zone.getAllocationState(); } }
@Override public String getVlanNetmask() { return _vlan.getVlanNetmask(); }
@Override public String getGateway() { return _vlan.getVlanGateway(); }
@Override public String getVlanTag() { return _vlan.getVlanTag(); }
@Override public String getVmwareDcName(Long clusterId) { String dcName = null; String url = findDetail(clusterId, "url").getValue(); String[] tokens = url.split("/"); // Cluster URL format is 'http://vcenter/dc/cluster' if (tokens != null && tokens.length > 3) dcName = tokens[3]; return dcName; } }
@Override public long getVlanId() { return _vlan.getId(); }
@Override public Long getNetworkId() { return _vlan.getNetworkId(); }
@Override public VlanType getVlanType() { return _vlan.getVlanType(); }
@Override public String getIpRange() { return _vlan.getIpRange(); }
protected ClusterDetailsDaoImpl() { ClusterSearch = createSearchBuilder(); ClusterSearch.and("clusterId", ClusterSearch.entity().getClusterId(), SearchCriteria.Op.EQ); ClusterSearch.done(); DetailSearch = createSearchBuilder(); DetailSearch.and("clusterId", DetailSearch.entity().getClusterId(), SearchCriteria.Op.EQ); DetailSearch.and("name", DetailSearch.entity().getName(), SearchCriteria.Op.EQ); DetailSearch.done(); }
@Override public String getIp6Gateway() { return _vlan.getIp6Gateway(); }
@Override public String getIp6Range() { return _vlan.getIp6Range(); }
@Override public String getIp6Cidr() { return _vlan.getIp6Cidr(); }
@Override public String getNetmask() { return _vlan.getVlanNetmask(); }
@Override public String getVlanGateway() { return _vlan.getVlanGateway(); }
@Override public String getConfigValue(long id, ConfigKey<?> key) { ClusterDetailsVO vo = findDetail(id, key.key()); return vo == null ? null : vo.getValue(); }