net.fortuna.mstor.connector
Interface MessageDelegate

All Known Implementing Classes:
AbstractMessageDelegate, JcrMessage, MetaMessage, YamlMetaMessage

public interface MessageDelegate

Implementors support delegation of specific functions from MStorMessage.

Author:
Ben
 $Id$

 Created on 30/07/2007
 

Method Summary
 javax.mail.Flags getFlags()
           
 java.util.Date getForwarded()
           
 javax.mail.internet.InternetHeaders getHeaders()
           
 java.io.InputStream getInputStream()
           
 MessageDelegate getInReplyTo()
           
 int getMessageNumber()
          Returns the 1-based number of the message the delegate is associated with.
 java.util.Date getReceived()
           
 java.util.List<? extends MessageDelegate> getReferences()
           
 java.util.Date getReplied()
           
 long getUid()
          Returns the UID associated with the message.
 boolean isExpunged()
           
 void saveChanges()
          Persist unsaved changes.
 void setExpunged(boolean expunged)
           
 void setFlags(javax.mail.Flags flags)
           
 void setForwarded(java.util.Date forwarded)
           
 void setHeaders(java.util.Enumeration<javax.mail.Header> headers)
           
 void setHeaders(javax.mail.internet.InternetHeaders headers)
          Saves headers to delegate.
 void setReceived(java.util.Date received)
           
 void setReplied(java.util.Date replied)
           
 void setUid(long uid)
          Sets the UID associated with the message.
 

Method Detail

isExpunged

boolean isExpunged()
Returns:
Returns the expunged.

setExpunged

void setExpunged(boolean expunged)
Parameters:
expunged - The expunged to set.

getHeaders

javax.mail.internet.InternetHeaders getHeaders()
Returns:
headers saved in delegate

setHeaders

void setHeaders(javax.mail.internet.InternetHeaders headers)
Saves headers to delegate. Implementations may choose to only save a subset of the specified headers.

Parameters:
headers - headers to save to delegate

setHeaders

void setHeaders(java.util.Enumeration<javax.mail.Header> headers)
Parameters:
headers - an enumeration of headers to attach to the message

getFlags

javax.mail.Flags getFlags()
Returns:
Returns the flags.

setFlags

void setFlags(javax.mail.Flags flags)
Parameters:
flags - The flags to set.

getForwarded

java.util.Date getForwarded()
Returns:
Returns the forwarded.

setForwarded

void setForwarded(java.util.Date forwarded)
Parameters:
forwarded - The forwarded to set.

getMessageNumber

int getMessageNumber()
Returns the 1-based number of the message the delegate is associated with. If a message number is not set it is assumed the message does not belong to a folder and thus has a message number of zero (0).

Returns:
the message number associated with this delegate, or zero if no message number is identified

getReceived

java.util.Date getReceived()
Returns:
Returns the received.

setReceived

void setReceived(java.util.Date received)
Parameters:
received - The received to set.

getReplied

java.util.Date getReplied()
Returns:
Returns the replied.

setReplied

void setReplied(java.util.Date replied)
Parameters:
replied - The replied to set.

getUid

long getUid()
Returns the UID associated with the message.

Returns:
a long representation of a UID, or -1 if no UID is assigned

setUid

void setUid(long uid)
Sets the UID associated with the message.

Parameters:
uid - a UID value to associate with the message

getInReplyTo

MessageDelegate getInReplyTo()
                             throws java.lang.UnsupportedOperationException
Returns:
a message to which this is a reply to
Throws:
java.lang.UnsupportedOperationException - if this method is not supported by the message implementation

getReferences

java.util.List<? extends MessageDelegate> getReferences()
                                                        throws java.lang.UnsupportedOperationException
Returns:
a list of messages related to this one
Throws:
java.lang.UnsupportedOperationException - if this method is not supported by the message implementation

getInputStream

java.io.InputStream getInputStream()
Returns:
an input stream for message data

saveChanges

void saveChanges()
                 throws DelegateException
Persist unsaved changes.

Throws:
DelegateException - where an error occurs saving changes in the message


Copyright © 2004-2011 Micronode. All Rights Reserved.