org.springframework.ws.transport.mail.monitor
Class Pop3PollingMonitoringStrategy
java.lang.Object
org.springframework.ws.transport.mail.monitor.AbstractMonitoringStrategy
org.springframework.ws.transport.mail.monitor.PollingMonitoringStrategy
org.springframework.ws.transport.mail.monitor.Pop3PollingMonitoringStrategy
- All Implemented Interfaces:
- MonitoringStrategy
public class Pop3PollingMonitoringStrategy
- extends PollingMonitoringStrategy
Implementation of the MonitoringStrategy
interface that uses a simple polling mechanism suitable for POP3
servers. Since POP3 does not have a native mechanism to determine which messages are "new", this implementation
simply retrieves all messages in the Folder
, and delete them afterwards. All messages in the POP3 mailbox are
therefore, by definition, new.
Setting the deleteMessages
property is therefore ignored: messages are always
deleted.
- Since:
- 1.5.0
- Author:
- Arjen Poutsma
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Pop3PollingMonitoringStrategy
public Pop3PollingMonitoringStrategy()
setDeleteMessages
public void setDeleteMessages(boolean deleteMessages)
- Description copied from class:
AbstractMonitoringStrategy
- Sets whether messages should be marked as
DELETED
after they have been
read. Default is true
.
- Overrides:
setDeleteMessages
in class AbstractMonitoringStrategy
afterSleep
protected void afterSleep(Folder folder)
throws MessagingException
- Re-opens the folder, if it closed.
- Overrides:
afterSleep
in class PollingMonitoringStrategy
- Parameters:
folder
- the folder to check for new messages
- Throws:
MessagingException
- in case of JavaMail errors
searchForNewMessages
protected Message[] searchForNewMessages(Folder folder)
throws MessagingException
- Simply returns
Folder.getMessages()
.
- Overrides:
searchForNewMessages
in class AbstractMonitoringStrategy
- Parameters:
folder
- the folder to retrieve new messages from
- Returns:
- the new messages
- Throws:
MessagingException
- in case of JavaMail errors
deleteMessages
protected void deleteMessages(Folder folder,
Message[] messages)
throws MessagingException
- Deletes the given messages from the given folder, and closes it to expunge deleted messages.
- Overrides:
deleteMessages
in class AbstractMonitoringStrategy
- Parameters:
folder
- the folder to delete messages frommessages
- the messages to delete
- Throws:
MessagingException
- in case of JavaMail errors
Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.