public CacheLocation getCacheLocationById(final String id) { for (final CacheLocation cacheLocation : configuredLocations.values()) { if (id.equals(cacheLocation.getId())) { return cacheLocation; } } return null; }
public void print(final Logger log) { final Collection<CacheLocation> locs = configuredLocations.values(); for (CacheLocation loc : locs) { final String id = loc.getId(); final List<Cache> caches = loc.getCaches(); log.warn("CacheLocation: " + id); for (Cache c : caches) { log.warn("\tCache: " + c.getId() + " : " + c.toString()); } } }
@Override @SuppressWarnings("PMD") public Collection<CacheLocation> getCacheLocations(String zoneId) { if (zoneId == null) { zoneId = ""; } final List<CacheLocation> result = new ArrayList<CacheLocation>(configuredLocations.size()); for (final CacheLocation location : configuredLocations.values()) { if (strsEqual(location.getZoneId(), zoneId)) { result.add(location); } } return result; }
/** * Sets the configured locations. * * @param locations the new configured locations */ public void setConfiguredLocations(final Set<CacheLocation> locations) { configuredLocations.clear(); for (final CacheLocation newLoc : locations) { configuredLocations.put(newLoc.getId(), newLoc); } }