Class MailReceiver
java.lang.Object
com.google.gerrit.server.mail.receive.MailReceiver
- All Implemented Interfaces:
LifecycleListener
,EventListener
- Direct Known Subclasses:
ImapMailReceiver
,Pop3MailReceiver
MailReceiver implements base functionality for receiving emails.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected void
dispatchMailProcessor
(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
(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.
-
Field Details
-
mailSettings
-
pendingDeletion
-
-
Method Details
-
start
public void start()Description copied from interface:LifecycleListener
Invoked when the server is starting.- Specified by:
start
in interfaceLifecycleListener
-
stop
public void stop()Description copied from interface:LifecycleListener
Invoked when the server is stopping.- Specified by:
stop
in interfaceLifecycleListener
-
requestDeletion
requestDeletion will enqueue an email for deletion and delete it the next time we connect to the email server. This does not guarantee deletion as the Gerrit instance might fail before we connect to the email server. -
handleEmails
handleEmails will open a connection to the mail server, remove emails where deletion is pending, read new email and close the connection.- Parameters:
async
- determines if processing messages should happen asynchronously- Throws:
MailTransferException
- in case of a known transport failureIOException
- in case of a low-level transport failure
-
dispatchMailProcessor
protected void dispatchMailProcessor(List<com.google.gerrit.mail.MailMessage> messages, boolean async)
-