1 /***
2 Copyright (C) 2005 The Java Community
3
4 This program is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free Software
6 Foundation; either version 2 of the License, or (at your option) any later
7 version.
8
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 Place, Suite 330, Boston, MA 02111-1307 USA.
16 */
17 package org.bejug.javacareers.jobs.service;
18
19 import java.util.List;
20
21 import org.bejug.javacareers.jobs.model.Comment;
22 import org.bejug.javacareers.jobs.model.Item;
23 import org.bejug.javacareers.jobs.model.User;
24
25 /***
26 * The comment service implementation which will be called by the view. This
27 * can be any view including RUI and/or HTML web clients.
28 *
29 * @author Peter Symoens (Last modified by $Author: shally $)
30 * @version $Revision: 1.4 $ - $Date: 2005/12/09 10:46:55 $
31 */
32 public interface CommentService {
33
34
35 /***
36 * @param comment The comment to store
37 */
38 void storeComment(Comment comment);
39
40 /***
41 * delete a comment.
42 *
43 * @param commentId the comment to delete
44 */
45 void deleteComment(Integer commentId);
46
47 /***
48 * get a comment.
49 *
50 * @param offerId The offer the comment is linked to
51 * @param subject The subject of the comment
52 * @return a comment
53 */
54 Comment getCommentBySubject(Integer offerId, String subject);
55
56 /***
57 * Get all comments related to the offer.
58 *
59 * @param rootOnly if true, return only the root comment.
60 * @param offerId the id of the offer to get the comment from.
61 * @return a list of comments related to the offer.
62 */
63 List getComments(Integer offerId, boolean rootOnly);
64
65 /***
66 * gets a comment by id.
67 *
68 * @param id the id of the comment
69 * @return comment Returns the wanted comment
70 */
71 Comment getComment(Integer id);
72
73 /***
74 * @param comment Comment
75 * @return childComments Returns the childComments of this comment
76 */
77 public List getChildComments(Comment comment);
78
79 /***
80 * @param user User
81 * @return The user's comments
82 */
83 public List getUserComments(User user);
84
85 /***
86 * @param comment Comment
87 * @return childCount Return the nr of child comments from this comment
88 */
89 int getChildCommentCount(Comment comment);
90
91 /***
92 * @param offer Offer
93 * @return commentCount Returns the nr of comments for this Offer.
94 */
95 int getCommentCount(Item offer);
96 }
97
98 /***
99 * $Log: CommentService.java,v $
100 * Revision 1.4 2005/12/09 10:46:55 shally
101 * Opkuis voor checkstyle en PMD
102 *
103 * Revision 1.3 2005/09/19 14:16:51 bavo_jcs
104 * Refactored comments to use Items
105 *
106 * Revision 1.2 2005/09/13 08:10:55 schauwvliege
107 * organize imports
108 *
109 * Revision 1.1 2005/08/26 07:58:27 ge0ffrey
110 * split up the sources in service, serviceimpl and webclient
111 *
112 * Revision 1.11 2005/08/10 09:04:49 bavo_jcs
113 * Optimized imports according to checkstyle
114 *
115 * Revision 1.10 2005/08/09 12:59:56 bavo_jcs
116 * Optimized imports
117 *
118 * Revision 1.9 2005/08/04 11:58:47 bme_jcs
119 * resolved checkstyle errors
120 *
121 * Revision 1.8 2005/08/03 13:16:03 bme_jcs
122 * getDao's removed and storeObject renamed to store
123 *
124 * Revision 1.7 2005/07/08 15:47:26 psong09
125 * modified comment component, removed subject field
126 *
127 * Revision 1.6 2005/07/07 12:42:38 psong09
128 * completed test coverage, implemented methods
129 *
130 * Revision 1.5 2005/07/04 07:54:00 psong09
131 * update comment component: added count(*) query, user login check, javascript
132 *
133 * Revision 1.4 2005/06/29 09:00:25 psong09
134 * comment component updated
135 *
136 * Revision 1.3 2005/06/28 07:38:29 psong09
137 * comment component updated
138 *
139 */