1 25 26 package org.nemesis.forum; 27 28 import java.util.Date ; 29 import java.util.Enumeration ; 30 import java.util.Iterator ; 31 32 import org.nemesis.forum.exception.ForumAlreadyExistsException; 33 import org.nemesis.forum.exception.ForumMessageNotFoundException; 34 import org.nemesis.forum.exception.ForumThreadNotFoundException; 35 import org.nemesis.forum.exception.UnauthorizedException; 36 37 38 42 public interface Forum { 43 44 49 public int getID(); 50 51 59 public String getName(); 60 61 74 public void setName(String name) throws UnauthorizedException, 75 ForumAlreadyExistsException; 76 77 82 public String getDescription(); 83 84 90 public void setDescription(String description) throws UnauthorizedException; 91 92 97 public Date getCreationDate(); 98 99 109 public void setCreationDate(Date creationDate) throws UnauthorizedException; 110 111 117 public Date getModifiedDate(); 118 119 129 public void setModifiedDate(Date modifiedDate) throws UnauthorizedException; 130 131 public Message getMessage(int messageID) throws ForumMessageNotFoundException; 132 133 134 142 public String getProperty(String name); 143 144 152 public void setProperty(String name, String value) throws UnauthorizedException; 153 154 159 public Enumeration propertyNames(); 160 161 169 public int getModerationType(); 170 171 181 public void setModerationType(int type) 182 throws UnauthorizedException; 183 184 192 public abstract ForumThread createThread(Message rootMessage) throws 193 UnauthorizedException; 194 195 201 public abstract Message createMessage(User user) 202 throws UnauthorizedException; 203 204 210 public void addThread(ForumThread thread) throws UnauthorizedException; 211 212 219 public void deleteThread(ForumThread thread) throws UnauthorizedException; 220 221 237 public void moveThread(ForumThread thread, Forum newForum) 238 throws UnauthorizedException, IllegalArgumentException ; 239 240 244 public ForumThread getThread(int threadID) 245 throws ForumThreadNotFoundException; 246 247 248 251 public Iterator threads(); 252 253 256 public Iterator threads(boolean approved); 257 258 264 public Iterator threads(int startIndex, int numResults); 265 266 272 public Iterator threads(boolean approved,int startIndex, int numResults); 273 274 277 public int getThreadCount(); 278 279 282 public int getMessageCount(); 283 284 289 public int getMessageCount(boolean approved); 290 291 292 293 294 299 public int getThreadCount(boolean approved); 300 301 302 303 311 public void addUserPermission(User user, int permissionType) 312 throws UnauthorizedException; 313 314 322 public void removeUserPermission(User user, int permissionType) 323 throws UnauthorizedException; 324 325 332 public int [] usersWithPermission(int permissionType) 333 throws UnauthorizedException; 334 335 341 public void addGroupPermission(Group group, int permissionType) 342 throws UnauthorizedException; 343 344 349 public void removeGroupPermission(Group group, int permissionType) 350 throws UnauthorizedException; 351 352 357 public int[] groupsWithPermission(int permissionType) 358 throws UnauthorizedException; 359 360 365 public Message applyFilters(Message message); 366 367 372 public MessageFilter[] getForumMessageFilters() 373 throws UnauthorizedException; 374 375 382 public void addForumMessageFilter(MessageFilter filter) 383 throws UnauthorizedException; 384 385 393 public void addForumMessageFilter(MessageFilter filter, int index) 394 throws UnauthorizedException; 395 396 403 public void removeForumMessageFilter(int index) 404 throws UnauthorizedException; 405 406 412 public abstract ForumPermissions getPermissions(Authorization authorization); 413 414 422 public boolean hasPermission(int type); 423 } 424 425 426 | Popular Tags |