org.sakaiproject.service.legacy.discussion
Interface DiscussionMessage

All Superinterfaces:
Comparable, Entity, Message
All Known Subinterfaces:
DiscussionMessageEdit
All Known Implementing Classes:
BaseDiscussionService.BaseDiscussionMessageEdit

public interface DiscussionMessage
extends Message

DiscussionMessage is the Interface for a CHEF Discussion message.

The discussion message has header fields (from, date) and a body (text). Each message also has an id, unique within the channel. All fields are read only.

Version:
$Revision: 632 $
Author:
University of Michigan, CHEF Software Development Team

Field Summary
 
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity
SEPARATOR
 
Method Summary
 DiscussionMessageHeader getDiscussionHeader()
          A (DiscussionMessageHeader) cover for getHeader to access the discussion message header.
 DiscussionMessage getLatestReply()
          Access the most recent reply to this message, if any.
 int getNumberOfReplies()
          Count the number of replies to this message (i.e. the size of the getReplies iterator).
 Iterator getReplies()
          Iterate over the messages that are a reply to this message
 int getReplyToDepth()
          Return the depth of replyTo value for this message.
 boolean hasReplies()
          Are there any replys to this message?
 
Methods inherited from interface org.sakaiproject.service.legacy.message.Message
getBody, getHeader
 
Methods inherited from interface org.sakaiproject.service.legacy.entity.Entity
getId, getProperties, getReference, getReference, getUrl, getUrl, toXml
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getDiscussionHeader

public DiscussionMessageHeader getDiscussionHeader()
A (DiscussionMessageHeader) cover for getHeader to access the discussion message header.

Returns:
The discussion message header.

getReplies

public Iterator getReplies()
Iterate over the messages that are a reply to this message

Returns:
an Iterator on DiscussionMessage objects that are replies to this message (may be empty).

hasReplies

public boolean hasReplies()
Are there any replys to this message?

Returns:
true if there are replies to this message, false if now.

getReplyToDepth

public int getReplyToDepth()
Return the depth of replyTo value for this message. Messages that are not a reply to any other message have depth = 0. If the message is a reply to a message, this message's depth is the replyTo's depth + 1.

Returns:
The depth of replyTo value for this message.

getLatestReply

public DiscussionMessage getLatestReply()
Access the most recent reply to this message, if any.

Returns:
the most recent DiscussionMessage reply to this message, or null if there are no replies.

getNumberOfReplies

public int getNumberOfReplies()
Count the number of replies to this message (i.e. the size of the getReplies iterator).

Returns:
the number of replies to this message.