com.atlassian.confluence.plugins.emailgateway.blacklist
Class RealTimeBlacklist<T>

java.lang.Object
  extended by com.atlassian.confluence.plugins.emailgateway.blacklist.RealTimeBlacklist<T>
All Implemented Interfaces:
Blacklist<T>

public class RealTimeBlacklist<T>
extends java.lang.Object
implements Blacklist<T>

Maintains a real-time, in-memory view of which sender accounts are sending us too many emails.

Since:
v5.0

Field Summary
static org.joda.time.Duration DEFAULT_EXPIRY_DURATION
           
 
Constructor Summary
RealTimeBlacklist()
           
RealTimeBlacklist(int maxCacheSize, int blacklistThreshold, org.joda.time.Duration expiryDuration)
           
 
Method Summary
 int getBlacklistThreshold()
           
 java.util.Map<T,? extends java.lang.Number> getCurrentCounts()
           
 org.joda.time.Duration getExpiryDuration()
           
 int getMaxCacheSize()
           
 boolean incrementAndCheckBlacklist(T key)
          Registers an event for the given key and check if that key is now black-listed
 boolean isBlackListed(T key)
          Checks to see if the give key is currently blacklisted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_EXPIRY_DURATION

public static final org.joda.time.Duration DEFAULT_EXPIRY_DURATION
Constructor Detail

RealTimeBlacklist

public RealTimeBlacklist()

RealTimeBlacklist

public RealTimeBlacklist(int maxCacheSize,
                         int blacklistThreshold,
                         org.joda.time.Duration expiryDuration)
Method Detail

getCurrentCounts

public java.util.Map<T,? extends java.lang.Number> getCurrentCounts()

incrementAndCheckBlacklist

public boolean incrementAndCheckBlacklist(T key)
Description copied from interface: Blacklist
Registers an event for the given key and check if that key is now black-listed

Specified by:
incrementAndCheckBlacklist in interface Blacklist<T>

isBlackListed

public boolean isBlackListed(T key)
Description copied from interface: Blacklist
Checks to see if the give key is currently blacklisted

Specified by:
isBlackListed in interface Blacklist<T>

getMaxCacheSize

public int getMaxCacheSize()

getBlacklistThreshold

public int getBlacklistThreshold()

getExpiryDuration

public org.joda.time.Duration getExpiryDuration()


Copyright © 2003-2014 Atlassian. All Rights Reserved.