public abstract class MailReceiver extends Object implements LifecycleListener
Modifier and Type | Class and Description |
---|---|
static class |
MailReceiver.Module |
Modifier and Type | Field and Description |
---|---|
protected EmailSettings |
mailSettings |
protected Set<String> |
pendingDeletion |
Modifier and Type | Method and Description |
---|---|
protected void |
dispatchMailProcessor(List<MailMessage> messages,
boolean async) |
abstract void |
handleEmails(boolean async)
handleEmails will open a connection to the mail server, remove emails where deletion is
pending, read new email and close the connection.
|
void |
requestDeletion(String messageId)
requestDeletion will enqueue an email for deletion and delete it the next time we connect to
the email server.
|
void |
start()
Invoked when the server is starting.
|
void |
stop()
Invoked when the server is stopping.
|
protected EmailSettings mailSettings
public void start()
LifecycleListener
start
in interface LifecycleListener
public void stop()
LifecycleListener
stop
in interface LifecycleListener
public void requestDeletion(String messageId)
messageId
- public abstract void handleEmails(boolean async)
async
- Determines if processing messages should happen asynchronous.protected void dispatchMailProcessor(List<MailMessage> messages, boolean async)