01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/discussion/tags/sakai_2-4-1/discussion-api/api/src/java/org/sakaiproject/discussion/api/DiscussionMessage.java $
03: * $Id: DiscussionMessage.java 8232 2006-04-25 01:11:55Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.discussion.api;
21:
22: import java.util.Iterator;
23:
24: import org.sakaiproject.message.api.Message;
25:
26: /**
27: * <p>
28: * DiscussionMessage is the Interface for a Sakai Discussion message.
29: * </p>
30: * <p>
31: * 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.
32: * </p>
33: */
34: public interface DiscussionMessage extends Message {
35: /**
36: * A (DiscussionMessageHeader) cover for getHeader to access the discussion message header.
37: *
38: * @return The discussion message header.
39: */
40: public DiscussionMessageHeader getDiscussionHeader();
41:
42: /**
43: * Iterate over the messages that are a reply to this message
44: *
45: * @return an Iterator on DiscussionMessage objects that are replies to this message (may be empty).
46: */
47: public Iterator getReplies();
48:
49: /**
50: * Are there any replys to this message?
51: *
52: * @return true if there are replies to this message, false if now.
53: */
54: public boolean hasReplies();
55:
56: /**
57: * 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.
58: *
59: * @return The depth of replyTo value for this message.
60: */
61: public int getReplyToDepth();
62:
63: /**
64: * Access the most recent reply to this message, if any.
65: *
66: * @return the most recent DiscussionMessage reply to this message, or null if there are no replies.
67: */
68: public DiscussionMessage getLatestReply();
69:
70: /**
71: * Count the number of replies to this message (i.e. the size of the getReplies iterator).
72: *
73: * @return the number of replies to this message.
74: */
75: public int getNumberOfReplies();
76: }
|