org.apache.james.fetchmail
Class FolderProcessor

java.lang.Object
  extended by org.apache.james.fetchmail.ProcessorAbstract
      extended by org.apache.james.fetchmail.FolderProcessor

public class FolderProcessor
extends ProcessorAbstract

Class FolderProcessor opens a Folder and iterates over all of the Messages, delegating their processing to MessageProcessor.

If isRecurse(), all subfolders are fetched recursively.

Creation Date: 25-May-03


Constructor Summary
protected FolderProcessor(javax.mail.Folder folder, org.apache.james.fetchmail.Account account)
          Constructor for FolderProcessor.
 
Method Summary
protected  void close()
          Method close.
protected  java.lang.Boolean computeMarkSeenPermanent()
          Answer the result of computing markSeenPermanent.
protected  javax.mail.Folder getFolder()
          Returns the folder.
protected  boolean handleMarkSeenNotPermanent(javax.mail.internet.MimeMessage aMessage)
          Handler for when the folder does not support the SEEN flag.
protected  java.lang.Boolean isMarkSeenPermanent()
          Returns the isMarkSeenPermanent.
protected  boolean isSeen(javax.mail.internet.MimeMessage aMessage)
          Answer if aMessage has been SEEN.
protected  void open()
          Method open.
 void process()
          Method process opens a Folder, fetches the Envelopes for all of its Messages, creates a MessageProcessor and runs it to process each message.
protected  void recurse()
          Method recurse.
protected  void setFolder(javax.mail.Folder folder)
          Sets the folder.
protected  void setMarkSeenPermanent(java.lang.Boolean markSeenPermanent)
          Sets the markSeenPermanent.
protected  void updateMarkSeenPermanent()
          Updates the markSeenPermanent.
 
Methods inherited from class org.apache.james.fetchmail.ProcessorAbstract
computeAttributePrefix, getAccount, getAttributePrefix, getBlacklist, getConfiguration, getCustomRecipientHeader, getDefaultDomainName, getDefaultLocalPart, getDeferredRecipientNotFoundMessageIDs, getFetchTaskName, getHost, getJavaMailFolderName, getJavaMailProviderName, getLocalUsers, getLogger, getMaxMessageSizeLimit, getPassword, getRecipient, getRemoteReceivedHeaderIndex, getServer, getSession, getUser, isDeferRecipientNotFound, isFetchAll, isIgnoreRecipientHeader, isLeave, isLeaveBlacklisted, isLeaveMaxMessageSizeExceeded, isLeaveRecipientNotFound, isLeaveRemoteReceivedHeaderInvalid, isLeaveRemoteRecipient, isLeaveUndeliverable, isLeaveUserUndefined, isMarkBlacklistedSeen, isMarkMaxMessageSizeExceededSeen, isMarkRecipientNotFoundSeen, isMarkRemoteReceivedHeaderInvalidSeen, isMarkRemoteRecipientSeen, isMarkSeen, isMarkUndeliverableSeen, isMarkUserUndefinedSeen, isOpenReadOnly, isRecurse, isRejectBlacklisted, isRejectMaxMessageSizeExceeded, isRejectRecipientNotFound, isRejectRemoteReceivedHeaderInvalid, isRejectRemoteRecipient, isRejectUserUndefined, setAccount, setAttributePrefix, updateAttributePrefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FolderProcessor

protected FolderProcessor(javax.mail.Folder folder,
                          org.apache.james.fetchmail.Account account)
Constructor for FolderProcessor.

Parameters:
folder - The folder to be fetched
account - The account being processed
Method Detail

process

public void process()
             throws javax.mail.MessagingException
Method process opens a Folder, fetches the Envelopes for all of its Messages, creates a MessageProcessor and runs it to process each message.

Specified by:
process in class ProcessorAbstract
Throws:
javax.mail.MessagingException
See Also:
ProcessorAbstract.process()

close

protected void close()
              throws javax.mail.MessagingException
Method close.

Throws:
javax.mail.MessagingException

recurse

protected void recurse()
                throws javax.mail.MessagingException
Method recurse.

Throws:
javax.mail.MessagingException

open

protected void open()
             throws javax.mail.MessagingException
Method open.

Throws:
javax.mail.MessagingException

getFolder

protected javax.mail.Folder getFolder()
Returns the folder.

Returns:
Folder

isSeen

protected boolean isSeen(javax.mail.internet.MimeMessage aMessage)
                  throws javax.mail.MessagingException
Answer if aMessage has been SEEN.

Parameters:
aMessage -
Returns:
boolean
Throws:
javax.mail.MessagingException

computeMarkSeenPermanent

protected java.lang.Boolean computeMarkSeenPermanent()
Answer the result of computing markSeenPermanent.

Returns:
Boolean

handleMarkSeenNotPermanent

protected boolean handleMarkSeenNotPermanent(javax.mail.internet.MimeMessage aMessage)
                                      throws javax.mail.MessagingException

Handler for when the folder does not support the SEEN flag. The default behaviour implemented here is to answer the value of the SEEN flag anyway.

Subclasses may choose to override this method and implement their own solutions.

Parameters:
aMessage -
Returns:
boolean
Throws:
javax.mail.MessagingException

setFolder

protected void setFolder(javax.mail.Folder folder)
Sets the folder.

Parameters:
folder - The folder to set

isMarkSeenPermanent

protected java.lang.Boolean isMarkSeenPermanent()
Returns the isMarkSeenPermanent.

Returns:
Boolean

setMarkSeenPermanent

protected void setMarkSeenPermanent(java.lang.Boolean markSeenPermanent)
Sets the markSeenPermanent.

Parameters:
markSeenPermanent - The isMarkSeenPermanent to set

updateMarkSeenPermanent

protected void updateMarkSeenPermanent()
Updates the markSeenPermanent.



Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.