Package net.fortuna.mstor.connector
Interface MessageDelegate
-
- All Known Implementing Classes:
AbstractMessageDelegate
,JcrMessage
,MetaMessage
,YamlMetaMessage
public interface MessageDelegate
Implementors support delegation of specific functions fromMStorMessage
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.mail.Flags
getFlags()
Date
getForwarded()
javax.mail.internet.InternetHeaders
getHeaders()
InputStream
getInputStream()
MessageDelegate
getInReplyTo()
int
getMessageNumber()
Returns the 1-based number of the message the delegate is associated with.Date
getReceived()
List<? extends MessageDelegate>
getReferences()
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(Date forwarded)
void
setHeaders(Enumeration<javax.mail.Header> headers)
void
setHeaders(javax.mail.internet.InternetHeaders headers)
Saves headers to delegate.void
setReceived(Date received)
void
setReplied(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(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
Date getForwarded()
- Returns:
- Returns the forwarded.
-
setForwarded
void setForwarded(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
Date getReceived()
- Returns:
- Returns the received.
-
setReceived
void setReceived(Date received)
- Parameters:
received
- The received to set.
-
getReplied
Date getReplied()
- Returns:
- Returns the replied.
-
setReplied
void setReplied(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 UnsupportedOperationException
- Returns:
- a message to which this is a reply to
- Throws:
UnsupportedOperationException
- if this method is not supported by the message implementation
-
getReferences
List<? extends MessageDelegate> getReferences() throws UnsupportedOperationException
- Returns:
- a list of messages related to this one
- Throws:
UnsupportedOperationException
- if this method is not supported by the message implementation
-
getInputStream
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
-
-