public abstract class MailReceiver extends java.lang.Object implements LifecycleListener
Modifier and Type | Class and Description |
---|---|
static class |
MailReceiver.Module |
Modifier and Type | Field and Description |
---|---|
protected EmailSettings |
mailSettings |
protected java.util.Set<java.lang.String> |
pendingDeletion |
Modifier and Type | Method and Description |
---|---|
protected void |
dispatchMailProcessor(java.util.List<com.google.gerrit.mail.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(java.lang.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
protected java.util.Set<java.lang.String> pendingDeletion
public void start()
LifecycleListener
start
in interface LifecycleListener
public void stop()
LifecycleListener
stop
in interface LifecycleListener
public void requestDeletion(java.lang.String messageId)
messageId
- public abstract void handleEmails(boolean async) throws MailTransferException, java.io.IOException
async
- determines if processing messages should happen asynchronouslyMailTransferException
- in case of a known transport failurejava.io.IOException
- in case of a low-level transport failureprotected void dispatchMailProcessor(java.util.List<com.google.gerrit.mail.MailMessage> messages, boolean async)