Package org.forgerock.openam.blacklist
Class CTSBlacklist<T extends Blacklistable>
- java.lang.Object
-
- org.forgerock.openam.blacklist.CTSBlacklist<T>
-
- Type Parameters:
T- The blacklist type.
- All Implemented Interfaces:
Blacklist<T>
public final class CTSBlacklist<T extends Blacklistable> extends Object implements Blacklist<T>
Entry blacklist that stores blacklisted entries in the CTS until they expire. A stable ID is stored in the CTS for each entry that has been blacklisted. Normal CTS reaper process will remove entries from the blacklist after they have expired.The fields used by this class are:
CoreTokenField.TOKEN_TYPE- the CTS token type.CoreTokenField.TOKEN_ID- theBlacklistable.getStableStorageID()(a random UUID that never changes for the lifetime of the entry).CoreTokenField.DATE_ONE- the timestamp (millisecond precision) at which the entry was first blacklisted. Used to discover newly blacklisted entries from other servers.CoreTokenField.STRING_ONE- the ID of the server on which the entry was first blacklisted. FromWebtopNamingQuery.getAMServerID().
In addition to blacklisting entries and checking the blacklist, this class also periodically polls the CTS for blacklist changes made on other servers since the last check. This is used to send local notifications to subscribed blacklist
Blacklist.Listeners for all blacklist entries, not just local ones. This feature is essential for correct operation of theBloomFilterBlacklist, which would otherwise report false negatives.- Since:
- 13.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.forgerock.openam.blacklist.Blacklist
Blacklist.Listener
-
-
Constructor Summary
Constructors Constructor Description CTSBlacklist(CTSPersistentStore cts, TokenType tokenType, ScheduledExecutorService scheduler, ThreadMonitor threadMonitor, WebtopNamingQuery serverConfig, long purgeDelayMs, long pollIntervalMs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidblacklist(T entry)Blacklists the given entry until its expiry time.booleanisBlacklisted(T entry)Determines whether the entry has previously been blacklisted.voidsubscribe(Blacklist.Listener listener)Subscribe for notifications when entries are blacklisted.
-
-
-
Constructor Detail
-
CTSBlacklist
public CTSBlacklist(CTSPersistentStore cts, TokenType tokenType, ScheduledExecutorService scheduler, ThreadMonitor threadMonitor, WebtopNamingQuery serverConfig, long purgeDelayMs, long pollIntervalMs)
-
-
Method Detail
-
blacklist
public void blacklist(T entry) throws BlacklistException
Description copied from interface:BlacklistBlacklists the given entry until its expiry time.- Specified by:
blacklistin interfaceBlacklist<T extends Blacklistable>- Parameters:
entry- The blacklist entry.- Throws:
BlacklistException- if the entry cannot be blacklisted for any reason.
-
isBlacklisted
public boolean isBlacklisted(T entry) throws BlacklistException
Description copied from interface:BlacklistDetermines whether the entry has previously been blacklisted. Note: entries are only blacklisted until they expire, so afalseresult does not mean the entry is valid. Further checks should be made to establish entry validity.- Specified by:
isBlacklistedin interfaceBlacklist<T extends Blacklistable>- Parameters:
entry- The entry to check for blacklisting.- Returns:
trueif the entry is currently blacklisted, orfalseif the entry is not blacklisted or has expired (and therefore been removed from the blacklist).- Throws:
BlacklistException- if an error occurs when checking the blacklist.
-
subscribe
public void subscribe(Blacklist.Listener listener)
Description copied from interface:BlacklistSubscribe for notifications when entries are blacklisted. Depending on the implementation, this may include only entries blacklisted in the local machine, or also notifications for entries blacklisted on other nodes in the cluster.- Specified by:
subscribein interfaceBlacklist<T extends Blacklistable>- Parameters:
listener- the event listener to call when entries are blacklisted.
-
-