/** * Returns a mapping from time to session IDs of sessions expiring at that time. */ synchronized public Map<Long, Set<Long>> getSessionExpiryMap() { // Convert time -> sessions map to time -> session IDs map Map<Long, Set<SessionImpl>> expiryMap = sessionExpiryQueue.getExpiryMap(); Map<Long, Set<Long>> sessionExpiryMap = new TreeMap<Long, Set<Long>>(); for (Entry<Long, Set<SessionImpl>> e : expiryMap.entrySet()) { Set<Long> ids = new HashSet<Long>(); sessionExpiryMap.put(e.getKey(), ids); for (SessionImpl s : e.getValue()) { ids.add(s.sessionId); } } return sessionExpiryMap; }