public Set<Service> grabServiceSet() { Set<Service> services = new HashSet<Service>(); for (SiteRecord siteRecord : siteRecordSet) services.addAll(siteRecord.getRecord().getServiceSet()); for (CassandraSiteCluster cassandraSiteCluster : cassandraSiteClusterSet) services.addAll(cassandraSiteCluster.getCassandraCluster().getServiceSet()); return services; }
private Map<Service, Set<Site>> computeServiceSiteMap() { Map<Service, Set<Site>> serviceSiteMap = new HashMap<Service, Set<Site>>(); for (SiteRecord siteRecord : siteRecordSet) { final Site site = siteRecord.getSite(); for (Service service : siteRecord.getRecord().getServiceSet()) { if (!serviceSiteMap.containsKey(service)) serviceSiteMap.put(service, new HashSet<Site>()); serviceSiteMap.get(service).add(site); } } for (CassandraSiteCluster siteCluster : cassandraSiteClusterSet) { final Site site = siteCluster.getSiteRecord().getSite(); for (Service service : siteCluster.getCassandraCluster().getServiceSet()) { if (!serviceSiteMap.containsKey(service)) serviceSiteMap.put(service, new HashSet<Site>()); serviceSiteMap.get(service).add(site); } } return serviceSiteMap; }