use of org.forgerock.openam.session.blacklist.CTSSessionBlacklist in project OpenAM by OpenRock.
the class CoreGuiceModule method getSessionBlacklist.
@Provides
@Singleton
@Inject
public static SessionBlacklist getSessionBlacklist(final CTSSessionBlacklist ctsBlacklist, final SessionServiceConfig serviceConfig) {
if (!serviceConfig.isSessionBlacklistingEnabled()) {
return NoOpSessionBlacklist.INSTANCE;
}
final long purgeDelayMs = serviceConfig.getSessionBlacklistPurgeDelay(TimeUnit.MILLISECONDS);
final int cacheSize = serviceConfig.getSessionBlacklistCacheSize();
final long pollIntervalMs = serviceConfig.getSessionBlacklistPollInterval(TimeUnit.MILLISECONDS);
SessionBlacklist blacklist = ctsBlacklist;
if (cacheSize > 0) {
blacklist = new CachingSessionBlacklist(blacklist, cacheSize, purgeDelayMs);
}
if (pollIntervalMs > 0) {
blacklist = new BloomFilterSessionBlacklist(blacklist, serviceConfig);
}
return blacklist;
}
Aggregations