net.fortuna.mstor.connector.jcr
Class JcrMessage

java.lang.Object
  extended by org.jcrom.AbstractJcrEntity
      extended by net.fortuna.mstor.connector.jcr.JcrMessage
All Implemented Interfaces:
java.io.Serializable, MessageDelegate

public class JcrMessage
extends org.jcrom.AbstractJcrEntity
implements MessageDelegate

Author:
Ben
 $Id$

 Created on 22/01/2009
 
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jcrom.AbstractJcrEntity
name, path
 
Constructor Summary
JcrMessage()
           
 
Method Summary
 javax.mail.Flags getFlags()
          
 java.util.Date getForwarded()
          
 javax.mail.internet.InternetHeaders getHeaders()
          
 java.io.InputStream getInputStream()
           
 JcrMessage getInReplyTo()
           
 int getMessageNumber()
          Returns the 1-based number of the message the delegate is associated with.
 java.util.Date getReceived()
          
 java.util.List<JcrMessage> 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 setInReplyTo(JcrMessage inReplyTo)
           
 void setMessage(javax.mail.Message message)
           
 void setMessageNumber(java.lang.Integer messageNumber)
           
 void setReceived(java.util.Date received)
          
 void setReplied(java.util.Date replied)
          
 void setUid(long uid)
          Sets the UID associated with the message.
 
Methods inherited from class org.jcrom.AbstractJcrEntity
getName, getPath, setName, setPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcrMessage

public JcrMessage()
Method Detail

getFlags

public javax.mail.Flags getFlags()

Specified by:
getFlags in interface MessageDelegate
Returns:
Returns the flags.

getForwarded

public java.util.Date getForwarded()

Specified by:
getForwarded in interface MessageDelegate
Returns:
Returns the forwarded.

getHeaders

public javax.mail.internet.InternetHeaders getHeaders()

Specified by:
getHeaders in interface MessageDelegate
Returns:
headers saved in delegate

getMessageNumber

public 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).

Specified by:
getMessageNumber in interface MessageDelegate
Returns:
the message number associated with this delegate, or zero if no message number is identified

getReceived

public java.util.Date getReceived()

Specified by:
getReceived in interface MessageDelegate
Returns:
Returns the received.

getReplied

public java.util.Date getReplied()

Specified by:
getReplied in interface MessageDelegate
Returns:
Returns the replied.

getUid

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

Specified by:
getUid in interface MessageDelegate
Returns:
a long representation of a UID, or -1 if no UID is assigned

isExpunged

public boolean isExpunged()

Specified by:
isExpunged in interface MessageDelegate
Returns:
Returns the expunged.

saveChanges

public void saveChanges()
                 throws DelegateException
Persist unsaved changes.

Specified by:
saveChanges in interface MessageDelegate
Throws:
DelegateException - where an error occurs saving changes in the message

setMessageNumber

public void setMessageNumber(java.lang.Integer messageNumber)
Parameters:
messageNumber -

setExpunged

public void setExpunged(boolean expunged)

Specified by:
setExpunged in interface MessageDelegate
Parameters:
expunged - The expunged to set.

getInputStream

public java.io.InputStream getInputStream()
Specified by:
getInputStream in interface MessageDelegate
Parameters:
folder -
Returns:

setFlags

public void setFlags(javax.mail.Flags flags)

Specified by:
setFlags in interface MessageDelegate
Parameters:
flags - The flags to set.

setForwarded

public void setForwarded(java.util.Date forwarded)

Specified by:
setForwarded in interface MessageDelegate
Parameters:
forwarded - The forwarded to set.

setHeaders

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

Specified by:
setHeaders in interface MessageDelegate
Parameters:
headers - headers to save to delegate

setHeaders

public void setHeaders(java.util.Enumeration<javax.mail.Header> headers)

Specified by:
setHeaders in interface MessageDelegate
Parameters:
headers - an enumeration of headers to attach to the message

setReceived

public void setReceived(java.util.Date received)

Specified by:
setReceived in interface MessageDelegate
Parameters:
received - The received to set.

setReplied

public void setReplied(java.util.Date replied)

Specified by:
setReplied in interface MessageDelegate
Parameters:
replied - The replied to set.

setUid

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

Specified by:
setUid in interface MessageDelegate
Parameters:
uid - a UID value to associate with the message

setMessage

public void setMessage(javax.mail.Message message)
                throws javax.mail.MessagingException,
                       java.io.IOException
Parameters:
message -
Throws:
javax.mail.MessagingException
java.io.IOException

getInReplyTo

public final JcrMessage getInReplyTo()
Specified by:
getInReplyTo in interface MessageDelegate
Returns:
the inReplyTo

setInReplyTo

public final void setInReplyTo(JcrMessage inReplyTo)
Parameters:
inReplyTo - the inReplyTo to set

getReferences

public final java.util.List<JcrMessage> getReferences()
Specified by:
getReferences in interface MessageDelegate
Returns:
the references


Copyright © 2004-2011 Micronode. All Rights Reserved.