Search in sources :

Example 1 with CTSSessionBlacklist

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;
}
Also used : BloomFilterSessionBlacklist(org.forgerock.openam.session.blacklist.BloomFilterSessionBlacklist) CachingSessionBlacklist(org.forgerock.openam.session.blacklist.CachingSessionBlacklist) CTSSessionBlacklist(org.forgerock.openam.session.blacklist.CTSSessionBlacklist) NoOpSessionBlacklist(org.forgerock.openam.session.blacklist.NoOpSessionBlacklist) SessionBlacklist(org.forgerock.openam.session.blacklist.SessionBlacklist) BloomFilterSessionBlacklist(org.forgerock.openam.session.blacklist.BloomFilterSessionBlacklist) CachingSessionBlacklist(org.forgerock.openam.session.blacklist.CachingSessionBlacklist) Inject(javax.inject.Inject) Singleton(javax.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

Provides (com.google.inject.Provides)1 Inject (javax.inject.Inject)1 Singleton (javax.inject.Singleton)1 BloomFilterSessionBlacklist (org.forgerock.openam.session.blacklist.BloomFilterSessionBlacklist)1 CTSSessionBlacklist (org.forgerock.openam.session.blacklist.CTSSessionBlacklist)1 CachingSessionBlacklist (org.forgerock.openam.session.blacklist.CachingSessionBlacklist)1 NoOpSessionBlacklist (org.forgerock.openam.session.blacklist.NoOpSessionBlacklist)1 SessionBlacklist (org.forgerock.openam.session.blacklist.SessionBlacklist)1