Spring Integration

org.springframework.integration.mail
Class Pop3MailReceiver

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.mail.AbstractMailReceiver
          extended by org.springframework.integration.mail.Pop3MailReceiver
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, NamedComponent, MailReceiver

public class Pop3MailReceiver
extends AbstractMailReceiver

A MailReceiver implementation that polls a mail server using the POP3 protocol.

Author:
Arjen Poutsma, Mark Fisher

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.springframework.integration.mail.MailReceiver
MailReceiver.MailReceiverContext
 
Field Summary
 
Fields inherited from class org.springframework.integration.mail.AbstractMailReceiver
folderOpenMode, initialized, logger, SI_USER_FLAG
 
Constructor Summary
Pop3MailReceiver()
           
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.
 
Methods inherited from class org.springframework.integration.mail.AbstractMailReceiver
destroy, fetchMessages, getFolder, onInit, openFolder, receive, setAdditionalFlags, setJavaMailAuthenticator, setJavaMailProperties, setMaxFetchSize, setProtocol, setSelectorExpression, setSession, setShouldDeleteMessages, shouldDeleteMessages, toString
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pop3MailReceiver

public Pop3MailReceiver()

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)
Method Detail

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

Spring Integration