|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.exchange.AbstractItem | +--com.compoze.exchange.Message
This class is an Exchange message. Message instances are obtained
either from the Folder
class using one of its
server*Messages
methods, or from the Messages
class. Methods that access properties on the class require that the
properties were loaded beforehand, when the message was initially retrieved.
Any methods in this class that begin with the string server
make a query to the server, and require that the
PropertyKey.MESSAGE_ID
be loaded beforehand. In order for
the correct class of message to be instantiated, the
PropertyKey.MESSAGE_TYPE
property must also be requested.
Any additional property requirements are indicated on each individual method.
Field Summary | |
static PropertyKey[] |
ALL_PROPS
Contains an array of all of the properties available on a message. |
Fields inherited from class com.compoze.exchange.AbstractItem |
m_props, m_session |
Method Summary | |
ActionStatus |
getActionStatus()
Gets the action status of the message. |
int |
getAttachmentCount()
Gets the number of attachments on the message. |
AttachmentInfo |
getAttachmentInfo(int iIndex)
Gets the attachment info for the specified index. |
AttachmentInfo[] |
getAttachmentInfoArray()
Gets information about the attachments on the message. |
java.lang.String[] |
getCategories()
Gets the categories of the message. |
java.lang.String |
getConversationIndex()
Gets the conversation index of the message. |
java.lang.String |
getConversationTopic()
Gets the conversation topic of the message. |
boolean |
getDeliveryReceipt()
Gets the delivery receipt flag. |
boolean |
getEncrypted()
Gets the encrypted flag. |
FlagStatus |
getFlagStatus()
Gets the flag status for the message. |
java.lang.String |
getFlagText()
Gets the flag text for the message. |
java.lang.String |
getFolderID()
Gets the ID of the folder that the message is in. |
java.lang.String |
getFolderName()
Gets the name of the folder that the message is in. |
java.lang.String |
getHtml()
Gets the HTML body. |
java.lang.String |
getHtml(boolean bBodyOnly,
IEmbeddedImageListener listener)
Gets the HTML body. |
java.lang.String |
getID()
Gets the ID of the message. |
Importance |
getImportance()
Gets the importance of the message. |
MessageType |
getMessageType()
Gets the type of the message. |
java.lang.String |
getNormalizedSubject()
Gets the normalized subject of the message (without RE:, FWD:, etc). |
boolean |
getReadReceipt()
Gets the read receipt for the message. |
RecipientInfo |
getRecipientInfo(int iIndex)
Gets information about the specified recipient. |
RecipientInfo[] |
getRecipientInfoArray()
Gets information about the recipients of the message. |
java.lang.String |
getRichTextFormat()
Gets the rich text format property of the message. |
java.lang.String |
getRichTextFormatAsHtml()
Gets the rich text format property of the message as HTML. |
java.lang.String |
getRichTextFormatAsHtml(boolean bBodyOnly,
IEmbeddedImageListener listener)
Gets the rich text format property of the message as HTML. |
java.lang.String |
getRichTextFormatAsPlain()
Retrieves the rich text format from a message and extracts the plain text from it. |
AddressEntryInfo |
getSender()
Gets information about the sender of the message. |
java.lang.String |
getSenderName()
Gets the true display name of the sender. |
Sensitivity |
getSensitivity()
Gets the sensitivity for the message. |
boolean |
getSent()
Gets the sent flag for the message. |
boolean |
getSigned()
Gets the signed flag for the message. |
int |
getSize()
Gets the size of the message. |
java.lang.String |
getStoreID()
Gets the ID of the store that the message is in. |
java.lang.String |
getSubject()
Gets the subject of the message. |
java.lang.String |
getSubject(int iLength)
Gets the subject of the message. |
boolean |
getSubmitted()
Gets the submitted flag of the message. |
java.lang.String |
getText()
Gets the text property of the message. |
java.util.Date |
getTimeCreated()
Gets the time that the message was created. |
java.util.Date |
getTimeExpired()
Gets the time that the message expired. |
java.util.Date |
getTimeLastModified()
Gets the time that the message was last modified. |
java.util.Date |
getTimeReceived()
Gets the time that the message was received. |
java.lang.String |
getTimeReceivedString(java.text.DateFormat dateFormat)
Gets the time that the message was received formatted to the specified date format. |
java.util.Date |
getTimeSent()
Gets the time that the message was sent. |
boolean |
getUnread()
Gets the unread flag for the message. |
boolean |
hasAttachment()
Checks if the message has at least one attachment. |
int |
serverAddAttachment(AttachmentType attachmentType,
java.lang.String sName,
java.lang.String sSource,
int iPosition,
javax.activation.DataHandler handler)
Hits the server to add an attachment to a message. |
void |
serverCopyTo(java.lang.String sFolderID)
Hits the server to copy the message to another folder. |
void |
serverDelete()
Hits the server to delete the message (the message is removed permanently, and not moved into deleted items). |
void |
serverDelete(boolean bDeletedItems)
Hits the server to delete the message. |
void |
serverDeleteAttachment(int iIndex)
Hits the server to delete an attachment from a message. |
javax.activation.DataHandler |
serverGetAttachment(int iIndex)
Queries the server to get the specified attachment data handler. |
Attachment[] |
serverGetAttachments(PropertyKey[] attachmentKeys)
Hits the server to get attachment information for a message. |
void |
serverMoveTo(DefaultFolderType folderType)
Hits the server to move the specified messages to another folder. |
void |
serverMoveTo(java.lang.String sFolderID)
Hits the server to move the message to another folder. |
UnresolvedRecipient[] |
serverResolveRecipients(boolean bRemove)
Hits the server to resolve recipients for the message. |
void |
serverUpdate()
Hits the server to update any changed properties. |
void |
serverUpdate(Recipient[] recipients,
boolean bSend,
boolean bSaveInSent)
Hits the server to update any changed properties. |
void |
serverUpdate(Recipient[] recipients,
int[] deleteRecipients,
boolean bSend,
boolean bSaveInSent)
Hits the server to update any changed properties. |
void |
setActionStatus(ActionStatus actionStatus)
Sets an action status for a message. |
void |
setCategories(java.lang.String[] categories)
Sets the categories of the message. |
void |
setConversationIndex(java.lang.String sIndex)
Sets the conversation index of the message. |
void |
setConversationTopic(java.lang.String sTopic)
Sets the conversation topic of the message. |
void |
setDeliveryReceipt(boolean bFlag)
Sets the delivery receipt flag. |
void |
setEncrypted(boolean bEncrypted)
Sets the encrypted flag. |
void |
setFlagStatus(FlagStatus status)
Sets the flag status for the message. |
void |
setFlagText(FlagText text)
Sets the flag text for the message. |
void |
setFlagText(java.lang.String sText)
Sets the flag text for the message. |
void |
setHtml(java.lang.String sHtml)
Sets the HTML body of the message. |
void |
setImportance(Importance importance)
Sets the importance of the message. |
void |
setMessageType(MessageType type)
Sets the type of the message. |
void |
setReadReceipt(boolean bReadReceipt)
Sets the read receipt for the message. |
void |
setRichTextFormat(java.lang.String sRichText)
Gets the rich text format property of the message. |
void |
setSender(AddressEntry addressEntry)
Sets the sender of the message. |
void |
setSensitivity(Sensitivity sensitivity)
Sets the sensitivity of the message. |
void |
setSent(boolean bSent)
Sets the sent flag for the message. |
void |
setSigned(boolean bSigned)
Sets the signed flag for the message. |
void |
setSubject(java.lang.String sSubject)
Sets the subject of the message. |
void |
setSubmitted(boolean bSubmitted)
Sets the submitted flag of the message. |
void |
setText(java.lang.String sText)
Sets the text property of the message. |
void |
setTimeExpired(java.util.Date timeExpired)
Sets the time that the message expired. |
void |
setTimeReceived(java.util.Date timeReceived)
Sets the time that the message was received. |
void |
setTimeSent(java.util.Date timeSent)
Sets the time that the message was sent. |
void |
setUnread(boolean bUnread)
Sets the unread flag for the message. |
java.lang.String |
toString()
Returns the string representation of the message. |
Methods inherited from class com.compoze.exchange.AbstractItem |
get, getBoolean, getByteArray, getDate, getDouble, getInt, getInvalidPropertyValues, getPropertyKeys, getString, getStringArray, getUpdatedPropertyValues, set, setBoolean, setByteArray, setDate, setDouble, setInt, setString, setStringArray |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final PropertyKey[] ALL_PROPS
Method Detail |
public java.lang.String getSenderName() throws ExchangeException
PropertyKey.SENT_REPRESENTING_NAME
public AttachmentInfo[] getAttachmentInfoArray() throws ExchangeException
AttachmentInfo
objects, or an empty
array if there are no attachmentsPropertyKey.MESSAGE_ATTACHMENT_INFO
public RecipientInfo[] getRecipientInfoArray() throws ExchangeException
NOTE:
Two different properties can be used to retrieve the recipient info,
MESSAGE_RECIPIENT_INFO
and
MESSAGE_RECIPIENT_INFO_OVERVIEW
. The overview property
contains a subset of the recipient information (only display name, index
and recipient type), and requires significantly less processing time.RecipientInfo
objects, or an empty
array if there are no recipientsPropertyKey.MESSAGE_RECIPIENT_INFO
,
PropertyKey.MESSAGE_RECIPIENT_INFO_OVERVIEW
public AddressEntryInfo getSender() throws ExchangeException
null
if not availablePropertyKey.MESSAGE_SENDER
public void setSender(AddressEntry addressEntry) throws ExchangeException
addressEntry
- the address entry of the senderExchangeException
- the address entry id must be availablepublic RecipientInfo getRecipientInfo(int iIndex) throws ExchangeException
NOTE:
Two different properties can be used to retrieve the recipient info,
MESSAGE_RECIPIENT_INFO
and
MESSAGE_RECIPIENT_INFO_OVERVIEW
. The overview property
contains a subset of the recipient information (only display name, index
and recipient type), and requires significantly less processing time. Index
values start at 1
.iIndex
- the index of the recipient in the recipients collection of the messagenull
if not foundPropertyKey.MESSAGE_RECIPIENT_INFO
,
PropertyKey.MESSAGE_RECIPIENT_INFO_OVERVIEW
public int getAttachmentCount() throws ExchangeException
PropertyKey.MESSAGE_ATTACHMENT_COUNT
public boolean hasAttachment() throws ExchangeException
true
if the message has at least one attachment; false
otherwisePropertyKey.MESSAGE_ATTACHMENT_COUNT
public java.lang.String[] getCategories() throws ExchangeException
PropertyKey.MESSAGE_CATEGORIES
public void setCategories(java.lang.String[] categories) throws ExchangeException
categories
- the categoriesPropertyKey.MESSAGE_CATEGORIES
public java.lang.String getConversationIndex() throws ExchangeException
PropertyKey.MESSAGE_CONVERSATION_INDEX
public void setConversationIndex(java.lang.String sIndex) throws ExchangeException
sIndex
- the conversation indexPropertyKey.MESSAGE_CONVERSATION_INDEX
public java.lang.String getConversationTopic() throws ExchangeException
PropertyKey.MESSAGE_CONVERSATION_TOPIC
public void setConversationTopic(java.lang.String sTopic) throws ExchangeException
sTopic
- the conversation topicPropertyKey.MESSAGE_CONVERSATION_TOPIC
public boolean getDeliveryReceipt() throws ExchangeException
true
to request a delivery receipt; false
otherwisePropertyKey.MESSAGE_DELIVERY_RECEIPT
public void setDeliveryReceipt(boolean bFlag) throws ExchangeException
bFlag
- true
to request a delivery receipt; false
otherwisePropertyKey.MESSAGE_DELIVERY_RECEIPT
public boolean getEncrypted() throws ExchangeException
PropertyKey.MESSAGE_ENCRYPTED
public void setEncrypted(boolean bEncrypted) throws ExchangeException
bEncrypted
- the encrypted flagPropertyKey.MESSAGE_ENCRYPTED
public java.lang.String getFolderID() throws ExchangeException
PropertyKey.MESSAGE_FOLDERID
public java.lang.String getFolderName() throws ExchangeException
public java.lang.String getID() throws ExchangeException
PropertyKey.MESSAGE_ID
public Importance getImportance() throws ExchangeException
null
if not availablePropertyKey.MESSAGE_IMPORTANCE
public void setImportance(Importance importance) throws ExchangeException
importance
- the importance of the message (may not be null
)PropertyKey.MESSAGE_IMPORTANCE
public boolean getReadReceipt() throws ExchangeException
true
to request a read receipt; false
otherwisePropertyKey.MESSAGE_READ_RECEIPT
public void setReadReceipt(boolean bReadReceipt) throws ExchangeException
bReadReceipt
- true
to request a read receipt; false
otherwisePropertyKey.MESSAGE_READ_RECEIPT
public Sensitivity getSensitivity() throws ExchangeException
null
if not setPropertyKey.MESSAGE_SENSITIVITY
public void setSensitivity(Sensitivity sensitivity) throws ExchangeException
sensitivity
- the sensitivity (may not be null
)PropertyKey.MESSAGE_SENSITIVITY
public boolean getSent() throws ExchangeException
PropertyKey.MESSAGE_SENT
public void setSent(boolean bSent) throws ExchangeException
bSent
- the sent flagPropertyKey.MESSAGE_SENT
public boolean getSigned() throws ExchangeException
PropertyKey.MESSAGE_SIGNED
public void setSigned(boolean bSigned) throws ExchangeException
bSigned
- the signed flagPropertyKey.MESSAGE_SIGNED
public int getSize() throws ExchangeException
PropertyKey.MESSAGE_SIZE
public java.lang.String getStoreID() throws ExchangeException
PropertyKey.MESSAGE_STOREID
public java.lang.String getSubject() throws ExchangeException
null
for no subjectPropertyKey.MESSAGE_SUBJECT
public java.lang.String getNormalizedSubject() throws ExchangeException
null
for no subjectPropertyKey.MESSAGE_SUBJECT
public java.lang.String getSubject(int iLength) throws ExchangeException
iLength
- the maximum length of the result (string plus "...")null
if for no subjectPropertyKey.MESSAGE_SUBJECT
public void setSubject(java.lang.String sSubject) throws ExchangeException
sSubject
- the subjectPropertyKey.MESSAGE_SUBJECT
public boolean getSubmitted() throws ExchangeException
PropertyKey.MESSAGE_SUBMITTED
public void setSubmitted(boolean bSubmitted) throws ExchangeException
bSubmitted
- the submitted flagPropertyKey.MESSAGE_SUBMITTED
public java.lang.String getText() throws ExchangeException
PropertyKey.MESSAGE_TEXT
public void setHtml(java.lang.String sHtml) throws ExchangeException
sHtml
- the HTML stringExchangeException
- if the HTML could not be setpublic java.lang.String getHtml() throws ExchangeException
getHtml(boolean, IEmbeddedImageListener)
.ExchangeException
- if there was an error getting the HTML bodypublic java.lang.String getHtml(boolean bBodyOnly, IEmbeddedImageListener listener) throws ExchangeException
bBodyOnly
- true
to return the body onlyIEmbeddedImageListener
- listenertrue
to return the body onlyExchangeException
- if there was an error getting the HTML bodyPropertyKey.MESSAGE_HTML
,
PropertyKey.SESSION_OPTION_EXCHANGE55
public void setRichTextFormat(java.lang.String sRichText) throws ExchangeException
sRichText
- rich text for the message (must be in RTF format)PropertyKey.MESSAGE_RTF
public java.lang.String getRichTextFormat() throws ExchangeException
PropertyKey.MESSAGE_RTF
public java.lang.String getRichTextFormatAsHtml() throws ExchangeException
PropertyKey.MESSAGE_RTF
public java.lang.String getRichTextFormatAsHtml(boolean bBodyOnly, IEmbeddedImageListener listener) throws ExchangeException
bBodyOnly
- set to true
to return only the
content of the message between
<BODY>
and </BODY>
tags
tagslistener
- the embedded (inline) link creator
is defined; pass null
to ignore inline image tagspublic java.lang.String getRichTextFormatAsPlain() throws ExchangeException
public void setText(java.lang.String sText) throws ExchangeException
setRichTextFormat
, so only one of the two properties should
be used).sText
- the text as the plain text body of the messagePropertyKey.MESSAGE_TEXT
public java.util.Date getTimeCreated() throws ExchangeException
PropertyKey.MESSAGE_TIME_CREATED
public java.util.Date getTimeExpired() throws ExchangeException
PropertyKey.MESSAGE_TIME_EXPIRED
public void setTimeExpired(java.util.Date timeExpired) throws ExchangeException
timeExpired
- the timePropertyKey.MESSAGE_TIME_EXPIRED
public java.util.Date getTimeLastModified() throws ExchangeException
PropertyKey.MESSAGE_TIME_LAST_MODIFIED
public java.util.Date getTimeReceived() throws ExchangeException
PropertyKey.MESSAGE_TIME_RECEIVED
public java.lang.String getTimeReceivedString(java.text.DateFormat dateFormat) throws ExchangeException
dateFormat
- the date format (may not be null
)PropertyKey.MESSAGE_TIME_RECEIVED
public void setTimeReceived(java.util.Date timeReceived) throws ExchangeException
timeReceived
- the timePropertyKey.MESSAGE_TIME_RECEIVED
public java.util.Date getTimeSent() throws ExchangeException
PropertyKey.MESSAGE_TIME_SENT
public void setTimeSent(java.util.Date timeSent) throws ExchangeException
timeSent
- the sent timePropertyKey.MESSAGE_TIME_SENT
public MessageType getMessageType() throws ExchangeException
PropertyKey.MESSAGE_TYPE
public void setMessageType(MessageType type) throws ExchangeException
type
- the type (may not be null
)PropertyKey.MESSAGE_TYPE
public boolean getUnread() throws ExchangeException
true
if the message is unread; false
otherwisePropertyKey.MESSAGE_UNREAD
public void setUnread(boolean bUnread) throws ExchangeException
bUnread
- true
to set the message as unread; false
otherwisePropertyKey.MESSAGE_UNREAD
public FlagStatus getFlagStatus() throws ExchangeException
PropertyKey.FLAG_STATUS
public void setFlagStatus(FlagStatus status) throws ExchangeException
status
- the flag status (may not be null
)PropertyKey.FLAG_STATUS
public java.lang.String getFlagText() throws ExchangeException
PropertyKey.FLAG_TEXT
public void setFlagText(java.lang.String sText) throws ExchangeException
sText
- the flag textPropertyKey.FLAG_TEXT
public void setFlagText(FlagText text) throws ExchangeException
text
- the flag text (may not be null
)PropertyKey.FLAG_TEXT
public void serverDelete() throws ExchangeException
public void serverDelete(boolean bDeletedItems) throws ExchangeException
bDeletedItems
- if true
, move the message
into deleted itemspublic Attachment[] serverGetAttachments(PropertyKey[] attachmentKeys) throws ExchangeException
attachmentKeys
- the property keys of the attachmentpublic javax.activation.DataHandler serverGetAttachment(int iIndex) throws ExchangeException
iIndex
- the index of the attachment in the attachments collection of the messagepublic UnresolvedRecipient[] serverResolveRecipients(boolean bRemove) throws ExchangeException
bRemove
- if true
, remove recipients if
they do not resolve.Recipient
objects of unresolved
recipients, or an array of zero length if all recipients were
resolvedpublic AttachmentInfo getAttachmentInfo(int iIndex) throws ExchangeException
iIndex
- the index of the attachment in the attachments collection of the messagenull
if not foundPropertyKey.MESSAGE_ATTACHMENT_INFO
public ActionStatus getActionStatus() throws ExchangeException
public void setActionStatus(ActionStatus actionStatus) throws ExchangeException
actionStatus
- the action statuspublic int serverAddAttachment(AttachmentType attachmentType, java.lang.String sName, java.lang.String sSource, int iPosition, javax.activation.DataHandler handler) throws ExchangeException
AttachmentType.FILE_DATA
- source parameter is ignored,
pass in null
AttachmentType.FILE_LINK
- pass in a link in UNC form,
such as \\server\path\file.doc
AttachmentType.OLE
- source parameter is ignored, pass in
null
AttachmentType.EMBEDDED_MESSAGE
- source parameter should
be an ID to a message
Note: the attachment is added to the message immediately.
There is no need to call serverUpdate()
.
Any number of attachments can be added to a message, but
individually none of them can be larger than
SessionInfo.serverGetMaxAttachmentSize()
.
attachmentType
- the attachment typesName
- the display name of the attachmentsSource
- the attachment sourceiPosition
- the position of the attachment in the message (0 to ignore)handler
- a handler that can supply the attachment datapublic void serverDeleteAttachment(int iIndex) throws ExchangeException
Note: the attachment is removed from the message immediately.
There is no need to call serverUpdate()
.
iIndex
- the index of the attachment in the attachments collection of the messagepublic void serverCopyTo(java.lang.String sFolderID) throws ExchangeException
sFolderID
- the ID of the target folderpublic void serverMoveTo(java.lang.String sFolderID) throws ExchangeException
sFolderID
- the ID of the target folderpublic void serverMoveTo(DefaultFolderType folderType) throws ExchangeException
folderType
- the default folder type the message will go inpublic void serverUpdate() throws ExchangeException
serverUpdate
in class AbstractItem
public void serverUpdate(Recipient[] recipients, boolean bSend, boolean bSaveInSent) throws ExchangeException
recipients
- the recipients to add to the message (or
null
for no recipients to add)bSend
- if true
, send the messagebSaveInSent
- if true
and sending the message,
save the message in the Sent Items
folderpublic void serverUpdate(Recipient[] recipients, int[] deleteRecipients, boolean bSend, boolean bSaveInSent) throws ExchangeException
recipients
- the recipients to add to the message (or
null
for no recipients to add)deleteRecipients
- the recipients to remove from the message (or
null
for no recipients to remove)bSend
- if true
, send the messagebSaveInSent
- if true
and sending the message,
save the message in the Sent Items
folderpublic java.lang.String toString()
toString
in class java.lang.Object
PropertyKey.MESSAGE_SUBJECT
,
PropertyKey.MESSAGE_ID
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |