/
DiscussionReplyDAO.java
107 lines (94 loc) · 2.39 KB
/
DiscussionReplyDAO.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package org.sagebionetworks.repo.model.dao.discussion;
import java.util.List;
import org.sagebionetworks.repo.model.discussion.DiscussionFilter;
import org.sagebionetworks.repo.model.discussion.DiscussionReplyBundle;
import org.sagebionetworks.repo.model.discussion.DiscussionReplyOrder;
import org.sagebionetworks.repo.model.discussion.DiscussionThreadReplyStat;
public interface DiscussionReplyDAO {
/**
* Create a new Reply
*
* @param threadId
* @param messageKey
* @param userId
* @return
*/
public DiscussionReplyBundle createReply(String threadId, String replyId, String messageKey,
Long userId);
/**
* Get a reply given its ID
*
* @param replyId
* @param filter
* @return
*/
public DiscussionReplyBundle getReply(long replyId, DiscussionFilter filter);
/**
* Get replies for a given thread.
* If includeDeleted is true, returns all replies found;
* otherwise, only returns non-deleted replies.
*
* @param threadId
* @param limit
* @param offset
* @param order
* @param ascending
* @param filter
* @return
*/
public List<DiscussionReplyBundle> getRepliesForThread(Long threadId,
Long limit, Long offset, DiscussionReplyOrder order, Boolean ascending,
DiscussionFilter filter);
/**
* Get the number of replies for a given thread.
* If includeDeleted is true, returns count of all replies found;
* otherwise, only returns count of non-deleted replies.
*
* @param threadId
* @param filter
* @return
*/
public long getReplyCount(long threadId, DiscussionFilter filter);
/**
* Mark a given reply as deleted
*
* @param replyId
*/
public void markReplyAsDeleted(long replyId);
/**
* Update a reply message
*
* @param replyId
* @param newKey
* @return
*/
public DiscussionReplyBundle updateMessageKey(long replyId, String newKey);
/**
* Get the Etag before updating a reply
*
* @param replyId
* @return
*/
public String getEtagForUpdate(long replyId);
/**
* Get the thread statistic about its replies
*
* @param threadId
* @return
*/
public DiscussionThreadReplyStat getThreadReplyStat(long threadId);
/**
* Get the projectID which this reply belongs to
*
* @param replyId
* @return
*/
public String getProjectId(String replyId);
/**
* Get the top 5 contributors for this thread
*
* @param threadId
* @return
*/
public List<String> getActiveAuthors(long threadId);
}