1
|
package eu.dnetlib.api.functionality;
|
2
|
|
3
|
import java.util.List;
|
4
|
|
5
|
import eu.dnetlib.api.DriverService;
|
6
|
import eu.dnetlib.domain.functionality.Post;
|
7
|
import eu.dnetlib.domain.functionality.Thread;
|
8
|
|
9
|
/**
|
10
|
* This interface describes the available methods of a forum service.
|
11
|
* @author thanos@di.uoa.gr
|
12
|
*
|
13
|
*/
|
14
|
public interface ForumService extends DriverService {
|
15
|
/**
|
16
|
* Open a new thread.
|
17
|
* @param communityId the id of the community that the thread belongs to
|
18
|
* @param userId the id of the user that opens the thread
|
19
|
* @param topic the topic of the thread
|
20
|
* @return the id of the thread just opened
|
21
|
* @throws ForumServiceException if any errors occur
|
22
|
*/
|
23
|
public long openThread(String communityId, String userId, String topic) throws ForumServiceException;
|
24
|
|
25
|
/**
|
26
|
* Edit an existing thread.
|
27
|
* @param threadId the id of the thread to edit
|
28
|
* @param topic the new topic of the thread
|
29
|
* @param posts the new posts of the thread
|
30
|
* @throws ForumServiceException if any errors occur
|
31
|
*/
|
32
|
public void editThread(long threadId, String topic, List<Post> posts) throws ForumServiceException;
|
33
|
|
34
|
/**
|
35
|
* Delete an existing thread.
|
36
|
* @param threadId the id of the thread to delete
|
37
|
* @throws ForumServiceException if any errors occur
|
38
|
*/
|
39
|
public void deleteThread(long threadId) throws ForumServiceException;
|
40
|
|
41
|
/**
|
42
|
* Search for an existing thread by id.
|
43
|
* @param threadId the id of the thread to search for
|
44
|
* @return the thread with the specified id or null if no such thread exists
|
45
|
* @throws ForumServiceException if any errors occur
|
46
|
*/
|
47
|
public Thread searchThread(long threadId) throws ForumServiceException;
|
48
|
|
49
|
/**
|
50
|
* Search for existing threads by community.
|
51
|
* @param communityId the id of the community the threads belong to
|
52
|
* @return a list containing all the threads that belong to the specified community
|
53
|
* @throws ForumServiceException if any errors occur
|
54
|
*/
|
55
|
public List<Thread> searchThread(String communityId) throws ForumServiceException;
|
56
|
}
|