|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.abraracourcix.alipes.listeners.AbstractListener
org.abraracourcix.alipes.listeners.email.SelectiveEmailListener
A more sophisticated listener which combines message templates with a dynamic filtering system allowing certain recipients to register interest with only certain resources. The class requires a file (defaults to email.txt) containing a list of properties associating regexps with email addresses. The regexps are applied to any object which fires an event and a positive match results in an email to the email addresses. @TODO not quite happy abou this since it seems to break the job of the Filter classes and be a bit monolithic
| Constructor Summary | |
SelectiveEmailListener(java.lang.String smtpServer,
java.lang.String user,
java.lang.String password,
java.lang.String returnAddress)
Constructor |
|
| Method Summary | |
void |
eventOccurred(Event event,
java.lang.Object resource)
Something's happened - fire off emails |
static void |
main(java.lang.String[] args)
Let's try it out. |
void |
setPropertiesFile(java.lang.String propertiesFile)
Setter |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SelectiveEmailListener(java.lang.String smtpServer,
java.lang.String user,
java.lang.String password,
java.lang.String returnAddress)
smtpServer - The mail server e.g. 127.0.0.1 port 25 is assumeduser - who's the email from?password - user's passwordreturnAddress - who to complain to?| Method Detail |
public void eventOccurred(Event event,
java.lang.Object resource)
throws MultiplexorException,
EmailListenerException
event - what's happenedresource - to whom
EmailListenerException - if unable to send email
MultiplexorException@TODO intercept emails, and wrap as multiplexed
public static void main(java.lang.String[] args)
throws ListenerException
args - password,
ListenerException - sometimespublic void setPropertiesFile(java.lang.String propertiesFile)
propertiesFile - The propertiesFile to set.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||