org.springframework.integration.mail
Class Pop3MailReceiver
java.lang.Object
org.springframework.integration.mail.AbstractMailReceiver
org.springframework.integration.mail.Pop3MailReceiver
- All Implemented Interfaces:
- org.springframework.beans.factory.DisposableBean, MailReceiver
public class Pop3MailReceiver
- extends AbstractMailReceiver
A MailReceiver
implementation that polls a mail server using the
POP3 protocol.
- Author:
- Arjen Poutsma, Mark Fisher
Constructor Summary |
Pop3MailReceiver(java.lang.String url)
|
Pop3MailReceiver(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
|
Pop3MailReceiver(java.lang.String host,
java.lang.String username,
java.lang.String password)
|
Method Summary |
protected void |
deleteMessages(javax.mail.Message[] messages)
Deletes the given messages from this receiver's folder, and closes it to expunge deleted messages. |
protected javax.mail.Message[] |
searchForNewMessages()
Subclasses must implement this method to return new mail messages. |
protected boolean |
shouldDeleteMessages()
POP3 is unable to detect new Messages, so this always returns true. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Pop3MailReceiver
public Pop3MailReceiver(java.lang.String url)
Pop3MailReceiver
public Pop3MailReceiver(java.lang.String host,
java.lang.String username,
java.lang.String password)
Pop3MailReceiver
public Pop3MailReceiver(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
shouldDeleteMessages
protected final boolean shouldDeleteMessages()
- POP3 is unable to detect new Messages, so this always returns true.
- Specified by:
shouldDeleteMessages
in class AbstractMailReceiver
searchForNewMessages
protected javax.mail.Message[] searchForNewMessages()
throws javax.mail.MessagingException
- Description copied from class:
AbstractMailReceiver
- Subclasses must implement this method to return new mail messages.
- Specified by:
searchForNewMessages
in class AbstractMailReceiver
- Throws:
javax.mail.MessagingException
deleteMessages
protected void deleteMessages(javax.mail.Message[] messages)
throws javax.mail.MessagingException
- Deletes the given messages from this receiver's folder, and closes it to expunge deleted messages.
- Overrides:
deleteMessages
in class AbstractMailReceiver
- Parameters:
messages
- the messages to delete
- Throws:
javax.mail.MessagingException
- in case of JavaMail errors