public boolean contains(List<? extends X509Certificate> key) { synchronized(map) { EntryWithAge entry = map.get(key); if ((entry != null) && (timeSource.currentTimeMillis() < entry.expireMillis)) { return true; } return false; } }
public void add(List<? extends X509Certificate> key) { synchronized(map) { long maxAge = timeSource.currentTimeMillis() + VALIDATION_CACHE_AGE_SECONDS * 1000L; map.put(key, new EntryWithAge(maxAge)); } }