package at.asitplus.eidas.specific.connector.storage; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; import eu.eidas.auth.commons.cache.ConcurrentMapService; import eu.eidas.auth.commons.tx.AbstractCorrelationMap; public class CacheWitheIDASBackend extends AbstractCorrelationMap { protected CacheWitheIDASBackend(ConcurrentMapService concurrentMapService) { super(concurrentMapService); } public List clean(Date now, long dataTimeOut) { List result = new ArrayList(); Iterator iterator = map.keySet().iterator(); while (iterator.hasNext()) { String key = iterator.next(); if (map.containsKey(key)) { TransactionStoreElement element = map.get(key); if (now.getTime() - element.getCreated().getTime() > dataTimeOut) result.add(key); } } return result; } }