T
- The blacklist type.public final class CachingBlacklist<T extends Blacklistable> extends Object implements Blacklist<T>
Blacklist.Listener
Constructor and Description |
---|
CachingBlacklist(Blacklist<T> delegate,
int maxSize,
long purgeDelayMs)
Constructs the caching entry blacklist with the given delegate blacklist and maximum cache size.
|
Modifier and Type | Method and Description |
---|---|
void |
blacklist(T entry)
Blacklists the given entry until its expiry time.
|
boolean |
isBlacklisted(T entry)
Determines whether the entry has previously been blacklisted.
|
void |
subscribe(Blacklist.Listener listener)
Subscribe for notifications when entries are blacklisted.
|
public CachingBlacklist(Blacklist<T> delegate, int maxSize, long purgeDelayMs)
delegate
- the delegate to defer cache misses to.maxSize
- the maximum size of the LRU cache to maintain.purgeDelayMs
- the additional delay before purging elements from the cache.public void blacklist(T entry) throws BlacklistException
Blacklist
blacklist
in interface Blacklist<T extends Blacklistable>
entry
- The blacklist entry.BlacklistException
- if the entry cannot be blacklisted for any reason.public boolean isBlacklisted(T entry) throws BlacklistException
Blacklist
false
result does not mean the entry is valid. Further checks
should be made to establish entry validity.isBlacklisted
in interface Blacklist<T extends Blacklistable>
entry
- The entry to check for blacklisting.true
if the entry is currently blacklisted, or false
if the entry is not
blacklisted or has expired (and therefore been removed from the blacklist).BlacklistException
- if an error occurs when checking the blacklist.public void subscribe(Blacklist.Listener listener)
Blacklist
subscribe
in interface Blacklist<T extends Blacklistable>
listener
- the event listener to call when entries are blacklisted.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.