org.starhope.appius.messaging
Class BadMailList

java.lang.Object
  extended by org.starhope.appius.sql.SQLPeerList
      extended by org.starhope.appius.messaging.BadMailList
All Implemented Interfaces:
Iterable, Collection

public class BadMailList
extends SQLPeerList

Author:
brpocock

Field Summary
private  ConcurrentHashMap<String,Date> badMail
          An index of bad eMail addresses with their expiry dates (for when to take them off of this list)
private static long serialVersionUID
           
 
Constructor Summary
BadMailList()
          Void constructor
 
Method Summary
 void add(String mail, Date until)
          Ban an eMail address from being used for a certain amount of time.
static BadMailList get()
           
 boolean isBad(String mail)
           
 void remove(String mail)
          Remove an eMail address from the banned list: administrative function.
 
Methods inherited from class org.starhope.appius.sql.SQLPeerList
add, addAll, clear, clearCache, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, sqlSelectCount, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

badMail

private final ConcurrentHashMap<String,Date> badMail
An index of bad eMail addresses with their expiry dates (for when to take them off of this list)

Constructor Detail

BadMailList

public BadMailList()
Void constructor

Method Detail

get

public static BadMailList get()
Returns:
Returns the singleton, global BadMailList.

add

public void add(String mail,
                Date until)
Ban an eMail address from being used for a certain amount of time. This will also close any User accounts which are associated with it.

Parameters:
mail - The address to ban
until - The date at which this ban expires

isBad

public boolean isBad(String mail)
Parameters:
mail - The eMail address to be tested
Returns:
true, if the eMail address is on the bad mail list and not yet expired from it.

remove

public void remove(String mail)
Remove an eMail address from the banned list: administrative function.

Parameters:
mail - The eMail address which will once again be allowed.