org.chorem.pollen.ui.utils
Class SendMail
java.lang.Object
java.lang.Thread
org.chorem.pollen.ui.utils.SendMail
- All Implemented Interfaces:
- Runnable
public class SendMail
- extends Thread
Mass mail management class.
This class store email to send in a csv file, and send it (one per second) in
a second time.
This class can restart to send mail at application restart.
For a mass mail sending to start, following files must be present:
- xxx.emails : CSV file ("email", "subject", "body")
- xxx.index : next index to manage ( inited at 0)
- Version:
- $Revision: 2927 $
Last update : $Date: 2010-03-10 19:08:53 +0100 (mer., 10 mars 2010) $
By : $Author: echatellier $
- Author:
- chatellier
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
EXTENSION_MAIL
public static final String EXTENSION_MAIL
- See Also:
- Constant Field Values
EXTENSION_INDEX
public static final String EXTENSION_INDEX
- See Also:
- Constant Field Values
configuration
protected Configuration configuration
- Pollen configuration.
mailStorageDirectory
protected File mailStorageDirectory
- Mail storage directory.
SendMail
public SendMail(Configuration configuration)
run
public void run()
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
sleep
protected void sleep()
throws InterruptedException
- Throws:
InterruptedException
wakeUp
public void wakeUp()
sendAllMails
protected void sendAllMails()
throws IOException
- Look for all xx.index file, and restart mail sending on
non ending mass mail sending.
After execution, delete mail and index file.
- Throws:
IOException
prepareMails
public void prepareMails(String id,
List<Map<String,String>> mailData)
throws IOException
- Prepare mail list.
TODO : improve configuration reading
- Parameters:
id - mailData -
- Throws:
IOException
Copyright © 2009-2010 CodeLutin. All Rights Reserved.