}
}
@Override
public Authentication get(String filterName, String cacheKey) {
AuthenticationCacheEntry entry = cache
.getIfPresent(new AuthenticationCacheKey(filterName, cacheKey));
if (entry == null) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("AuthenticationCache has no entry for " + filterName
+ ", " + cacheKey);
}
return null;
}
long currentTime=System.currentTimeMillis();
if(entry.hasExpired(currentTime)) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Entry has expired");
}
cache.invalidate(entry);
return null;
}
entry.setLastAccessed(System.currentTimeMillis());
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("AuthenticationCache found an entry for " + filterName
+ ", " + cacheKey);
}
return entry.getAuthentication();
}