|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.discussion.Message
This class represents a message. Messages are grouped under a topic and can have sub-messages.
To add and search for message, see the Messages
collection
class available from a Topic
. Once the message is obtained, its
accessor methods may be called to
set and get properties. The update()
method
must be called to store any changes to the server.
The following table contains the mappings from Message properties to their corresponding Java methods:
Field Summary | |
protected int |
m_iMessageCount
|
Constructor Summary | |
Message()
Constructor. |
Method Summary | |
FileAttachment |
addFileAttachment(java.lang.String sFilename,
java.io.InputStream io)
Adds the file attachment to this message. |
void |
delete()
Deletes the message. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
ApprovalStatus |
getApprovalStatus()
Gets the approval status of the message. |
java.lang.String |
getAuthor()
Gets the name of the author. |
java.lang.String |
getBody()
Gets the body of the message. |
java.lang.String |
getContentType()
Gets the content type of the message body. |
long |
getCustomNum1()
Gets the custom number1 field of the message. |
long |
getCustomNum2()
Gets the custom number2 field of the message. |
long |
getCustomNum3()
Gets the custom number3 field of the message. |
long |
getCustomNum4()
Gets the custom number4 field of the message. |
java.lang.String |
getCustomStr1()
Gets the custom string1 field of the message. |
java.lang.String |
getCustomStr2()
Gets the custom string2 field of the message. |
java.lang.String |
getCustomStr3()
Gets the custom string3 field of the message. |
java.lang.String |
getCustomStr4()
Gets the custom string4 field of the message. |
java.util.Date |
getDateCreated()
Gets the date the message was created. |
java.util.Date |
getDateLastModified()
Gets the date the message was last modified. |
FileAttachment |
getFileAttachment(long lAttachmentID)
Gets the file attachment by the specified id. |
int |
getFileAttachmentCount()
Gets the number of files associated with this message. |
java.util.List |
getFileAttachments()
Gets a list of file attachments for this message. |
long |
getID()
Gets the unique identifier (id) of the message. |
java.lang.String |
getKeywords()
Gets the keywords associated with this message. |
boolean |
getMaskAuthor()
Gets the mask author setting. |
int |
getMessageCount()
Gets the number of messages associated with the messages under this message. |
Messages |
getMessages()
Gets the sub-messages of this message. |
Message |
getParentMessage()
Gets the parent message this message is associated with. |
long |
getParentMessageID()
Gets the parent message id this message is associated with. |
java.lang.String |
getSubject()
Gets the subject of the message. |
java.lang.String |
getSubject(int iLength)
Gets the subject of the message. |
Topic |
getTopic()
Gets the topic this message is associated with. |
long |
getTopicID()
Gets the topic id this message is associated with. |
java.lang.String |
getUnmaskedAuthor()
Gets the name of the author without a mask. |
boolean |
hasFileAttachment()
Checks if the message has any file attachments. |
boolean |
hasParentMessage()
Checks if this message has a parent message. |
boolean |
isAuthor()
Checks if this user is the author of the message. |
void |
removeFileAttachment(long lAttachmentID)
Removes the file attachment by the specified id. |
void |
setApprovalStatus(ApprovalStatus status)
Sets the approval status of the message. |
void |
setBody(java.lang.String sBody)
Sets the body of the message. |
void |
setContentType(java.lang.String sContentType)
Sets the content type of the message body. |
void |
setCustomNum1(long lCustomNum1)
Sets the custom number1 field of the message. |
void |
setCustomNum2(long lCustomNum2)
Sets the custom number2 field of the message. |
void |
setCustomNum3(long lCustomNum3)
Sets the custom number3 field of the message. |
void |
setCustomNum4(long lCustomNum4)
Sets the custom number4 field of the message. |
void |
setCustomStr1(java.lang.String sCustomStr1)
Sets the custom string1 field of the message. |
void |
setCustomStr2(java.lang.String sCustomStr2)
Sets the custom string2 field of the message. |
void |
setCustomStr3(java.lang.String sCustomStr3)
Sets the custom string3 field of the message. |
void |
setCustomStr4(java.lang.String sCustomStr4)
Sets the custom string4 field of the message. |
void |
setKeywords(java.lang.String sKeywords)
Sets the keywords associated with this message. |
void |
setKeywords(java.lang.String[] keywords)
Sets the keywords associated with this message. |
void |
setMaskAuthor(boolean bMaskAuthor)
Sets the mask author setting. |
void |
setSubject(java.lang.String sSubject)
Sets the subject of the message. |
java.lang.String |
toString()
Returns a string representation of the object. |
boolean |
update()
Updates the message (saves the message entry). |
boolean |
update(boolean bForce)
Updates the message (saves the message entry). |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int m_iMessageCount
Constructor Detail |
public Message()
Method Detail |
public long getID()
public long getTopicID()
public Topic getTopic()
null
if an error occurspublic boolean hasParentMessage()
true
if this message has a parent; false
otherwisegetParentMessage()
public long getParentMessageID()
getParentMessage()
public Message getParentMessage()
null
if top level messagepublic java.lang.String getAuthor()
true
, the author name
will be masked as '*' characters.getMaskAuthor()
public java.lang.String getUnmaskedAuthor() throws java.security.AccessControlException
java.security.AccessControlException
- occurs if the caller does not have MODERATOR
permissiongetMaskAuthor()
public boolean getMaskAuthor()
true
to mask the author; false
otherwisepublic void setMaskAuthor(boolean bMaskAuthor) throws java.security.AccessControlException
bMaskAuthor
- true
to mask the author; false
otherwisejava.security.AccessControlException
- occurs if an attempt is made to set the mask author by a user without MODERATOR
or EDIT
permissionpublic boolean isAuthor()
true
if this user is the message; false
otherwisepublic ApprovalStatus getApprovalStatus()
public void setApprovalStatus(ApprovalStatus status) throws java.security.AccessControlException
status
- the approval status (may not be null
)java.security.AccessControlException
- occurs if an attempt is made to set the approval status by a user without MODERATOR
permissionpublic java.lang.String getSubject()
null
if no subject is setpublic java.lang.String getSubject(int iLength)
iLength
- the maximum length of the result (string plus "...")public void setSubject(java.lang.String sSubject)
sSubject
- the subject of the message or null
for no subjectpublic java.util.Date getDateCreated()
public java.lang.String getContentType()
text/plain
can be displayed as plain text.getBody()
public void setContentType(java.lang.String sContentType)
sContentType
- the MIME content type of the body (may not be null
or empty)getBody()
public java.lang.String getBody()
null
for no bodypublic void setBody(java.lang.String sBody)
sBody
- the body of the message or null
for no bodypublic int getMessageCount()
public java.lang.String getKeywords()
null
for nonesetKeywords(String)
public void setKeywords(java.lang.String[] keywords)
The specified array of keywords are converted into
a space delimited String
of keywords.
Existing keywords (if any) are over-written by the
specified keywords.
keywords
- an array of keywords to associate with this message (may not be null
)setKeywords(String)
public void setKeywords(java.lang.String sKeywords)
Existing keywords (if any) are over-written by the specified keywords.
sKeywords
- the keywords to associate with this message or null
for nonepublic java.util.Date getDateLastModified()
public long getCustomNum1()
null
if the custom number1 field is not setpublic void setCustomNum1(long lCustomNum1)
lCustomNum1
- the custom number1 field of the messagepublic long getCustomNum2()
null
if the custom number2 field is not setpublic void setCustomNum2(long lCustomNum2)
lCustomNum2
- the custom number2 field of the messagepublic long getCustomNum3()
null
if the custom number3 field is not setpublic void setCustomNum3(long lCustomNum3)
lCustomNum3
- the custom number3 field of the messagepublic long getCustomNum4()
null
if the custom number4 field is not setpublic void setCustomNum4(long lCustomNum4)
lCustomNum4
- the custom number4 field of the messagepublic java.lang.String getCustomStr1()
null
if the custom string1 field is not setpublic void setCustomStr1(java.lang.String sCustomStr1)
sCustomStr1
- the custom string1 field of the messagepublic java.lang.String getCustomStr2()
null
if the custom string2 field is not setpublic void setCustomStr2(java.lang.String sCustomStr2)
sCustomStr2
- the custom string2 field of the messagepublic java.lang.String getCustomStr3()
null
if the custom string3 field is not setpublic void setCustomStr3(java.lang.String sCustomStr3)
sCustomStr3
- the custom string3 field of the messagepublic java.lang.String getCustomStr4()
null
if the custom string4 field is not setpublic void setCustomStr4(java.lang.String sCustomStr4)
sCustomStr4
- the custom string4 field of the messagepublic Messages getMessages()
null
if there are no sub-messages)public boolean update() throws java.security.AccessControlException
true
if the update is successful; false
otherwisejava.security.AccessControlException
- occurs if the user does not have permission to edit the messagepublic boolean update(boolean bForce) throws java.security.AccessControlException
bForce
- true
to force the update; false
otherwise (currently ignored)true
if the update is successful; false
otherwisejava.security.AccessControlException
- occurs if the user does not have permission to edit the messagepublic void delete() throws java.security.AccessControlException
java.security.AccessControlException
- occurs if the user does not have permission to delete the messagepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare for eqaulitytrue
if the objects are equals; false
otherwisepublic boolean hasFileAttachment()
true
if the message has file attachments; false
otherwisepublic int getFileAttachmentCount()
public void removeFileAttachment(long lAttachmentID)
public FileAttachment getFileAttachment(long lAttachmentID)
public java.util.List getFileAttachments()
FileAttachment
objectspublic FileAttachment addFileAttachment(java.lang.String sFilename, java.io.InputStream io) throws java.io.IOException
update()
is not required.sFilename
- the file attachment name (may not be null
)io
- the input stream to the file attachment datapublic java.lang.String toString()
toString
in class java.lang.Object
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |