talx x1.0.5

talx.model.mail
Class Outbox

java.lang.Object
  extended bytalx.model.mail.Outbox
Direct Known Subclasses:
Trash

public class Outbox
extends java.lang.Object

Sentinel class for a message folder. This class wraps a Folder from a store using tal protocol. This class contains methods for finding and moving messages, but does not allow message deletion. This class handles openning the folder in asynchronously, so the main thread can create the folder, go back to processing, and use the store later when it has finished openning.


Field Summary
protected  javax.mail.Folder folder
          The outbox folder.
static java.lang.String INBOX_NAME
           
static java.lang.String OUTBOX_NAME
           
static java.lang.String TRASH_NAME
           
 
Constructor Summary
protected Outbox(javax.mail.Folder f)
           
 
Method Summary
 javax.mail.internet.MimeMessage add(javax.mail.internet.MimeMessage m)
          Copies the given message into this outbox.
 void addMessageCountListener(javax.mail.event.MessageCountListener l)
           
 void close()
           
 void closeStore()
           
 boolean contains(javax.mail.internet.MimeMessage m)
          Returns true if the message is part of the underlying folder.
 javax.mail.internet.MimeMessage[] find(javax.mail.search.SearchTerm criteria)
          Searches through the folder for the messages matching to criteria.
 javax.mail.internet.MimeMessage[] find(javax.mail.search.SearchTerm criteria, java.util.Comparator ordering)
          Searches through the folder for the messages matching to criteria.
 javax.mail.internet.MimeMessage find(java.lang.String id)
          Searches through the folder for the message with the given ID.
static Outbox[] getBoxSet(Settings settings)
           
 javax.mail.internet.MimeMessage move(javax.mail.internet.MimeMessage m, Outbox destination)
          Moves the message to the given outbox and removes it from this Outbox.
 void removeMessageCountListener(javax.mail.event.MessageCountListener l)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INBOX_NAME

public static final java.lang.String INBOX_NAME
See Also:
Constant Field Values

OUTBOX_NAME

public static final java.lang.String OUTBOX_NAME
See Also:
Constant Field Values

TRASH_NAME

public static final java.lang.String TRASH_NAME
See Also:
Constant Field Values

folder

protected javax.mail.Folder folder
The outbox folder.

Constructor Detail

Outbox

protected Outbox(javax.mail.Folder f)
          throws javax.mail.MessagingException
Method Detail

getBoxSet

public static Outbox[] getBoxSet(Settings settings)
                          throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

contains

public boolean contains(javax.mail.internet.MimeMessage m)
Returns true if the message is part of the underlying folder.


move

public javax.mail.internet.MimeMessage move(javax.mail.internet.MimeMessage m,
                                            Outbox destination)
Moves the message to the given outbox and removes it from this Outbox.

Returns:
a reference to the message in destination.

add

public javax.mail.internet.MimeMessage add(javax.mail.internet.MimeMessage m)
                                    throws javax.mail.MessagingException
Copies the given message into this outbox.
Note: If the message already exists in this outbox, this method will create another copy.

Returns:
the message copy from this outbox.
Throws:
javax.mail.MessagingException

find

public javax.mail.internet.MimeMessage find(java.lang.String id)
Searches through the folder for the message with the given ID.

Returns:
the list of qualifying messages, or null if a messaging exception was thrown.

find

public javax.mail.internet.MimeMessage[] find(javax.mail.search.SearchTerm criteria)
Searches through the folder for the messages matching to criteria. The returned array is in date order from oldest to newest.

Parameters:
criteria - the SearchTerm specifying which messages to return.
Returns:
the list of qualifying messages, or null if a messaging exception was thrown.

find

public javax.mail.internet.MimeMessage[] find(javax.mail.search.SearchTerm criteria,
                                              java.util.Comparator ordering)
Searches through the folder for the messages matching to criteria.

Parameters:
criteria - the SearchTerm specifying which messages to return.
ordering - the Comparator specifying the order of the returned messages.
Returns:
the list of qualifying messages, or null if a messaging exception was thrown.

addMessageCountListener

public void addMessageCountListener(javax.mail.event.MessageCountListener l)

removeMessageCountListener

public void removeMessageCountListener(javax.mail.event.MessageCountListener l)

close

public void close()

closeStore

public void closeStore()

toString

public java.lang.String toString()

talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.