01: package dalma.endpoints.email;
02:
03: import dalma.Conversation;
04:
05: import javax.mail.internet.MimeMessage;
06:
07: /**
08: * Callback interface that receives e-mails that are not correlated
09: * to existing {@link Conversation}s.
10: *
11: * <p>
12: * When a {@link Conversation} sends out an e-mail through
13: * the {@link EmailEndPoint#waitForReply} methods, the reply e-mail
14: * will go directly to that conversation. Other e-mails will be
15: * sent to this listener.
16: *
17: * @see EmailEndPoint#setNewMailHandler(NewMailHandler)
18: * @author Kohsuke Kawaguchi
19: */
20: public interface NewMailHandler {
21: /**
22: * Called for each new e-mail.
23: *
24: * @param mail
25: * represents a received e-mail.
26: * always non-null.
27: * @throws Exception
28: * if the method throws any {@link Throwable},
29: * it will be simply logged.
30: */
31: void onNewMail(MimeMessage mail) throws Exception;
32: }
|