Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/service/INoticeboardService.java =================================================================== diff -u -r6cce13e2c656d9cab6d0fc4a133245be0e2299c0 -r7065c3c7f27c9dbc49864cefcea4740b0ced2fc4 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/service/INoticeboardService.java (.../INoticeboardService.java) (revision 6cce13e2c656d9cab6d0fc4a133245be0e2299c0) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/service/INoticeboardService.java (.../INoticeboardService.java) (revision 7065c3c7f27c9dbc49864cefcea4740b0ced2fc4) @@ -23,8 +23,9 @@ import org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent; import org.lamsfoundation.lams.tool.noticeboard.NoticeboardSession; -; +import org.lamsfoundation.lams.tool.noticeboard.NoticeboardUser; + /** * Defines the contract that the tool service provider must follow * @@ -84,7 +85,7 @@ * * @param nbContent The instance of NoticeboardContent in which corresponding instances of NoticeboardSession should be deleted. */ - public void removeNoticeboardSessions(NoticeboardContent nbContent); + public void removeNoticeboardSessionsFromContent(NoticeboardContent nbContent); /** *

Delete the given instance of NoticeboardContent with the @@ -161,4 +162,90 @@ * @param uid an identifier for the NoticeboardSession instance. */ public void removeSessionByUID(Long uid); + + /** + *

Deletes all instances of NoticeboardUser that are associated + * with the given instance of NoticeboardSession

+ * + * @param nbSession The instance of NoticeboardSession in which corresponding instances of NoticeboardUser should be deleted. + */ + public void removeNoticeboardUsersFromSession(NoticeboardSession nbSession); + + /** + *

Returns the persistent instance of NoticeboardSession + * with the given noticeboard user iduserId, returns null if not found. + * + * @param userId The user id + * @return a persistent instance of NoticeboardSession or null if not found. + */ + public NoticeboardSession retrieveNbSessionByUserID(Long userId); + + //=================================================================== + // NoticeboardUser access methods + //=================================================================== + /** + *

Return the persistent instance of a NoticeboardUser + * with the given user idnbUserId, + * returns null if not found.

+ * + * @param nbUserId The user id of the instance of NoticeboardUser + * @return the persistent instance of a NoticeboardUser or null if not found. + */ + public NoticeboardUser retrieveNoticeboardUser(Long nbUserId); + + /** + *

Return the persistent instance of a NoticeboardUser + * with the given identifier uid, returns null if not found.

+ * + * @param uid an identifier for the NoticeboardUser object. + * @return the persistent instance of a NoticeboardUser or null if not found + */ + public NoticeboardUser retrieveNoticeboardUserByUID(Long uid); + + /** + * Persists the new NoticeboardUser object into the database. + * + * @param nbUser the NoticeboardUser object to persist + */ + public void saveNoticeboardUser(NoticeboardUser nbUser); + + + /** + * Updates the values of the noticeboard user. + * @param nbUser + */ + public void updateNoticeboardUser(NoticeboardUser nbUser); + + /** + * Remove the noticeboard user object with user id of + * that specified in the argument. + * + * @param nbUserId The id of the requested noticeboard object + * + */ + public void removeUser(Long nbUserId); + + /** + *

Delete the given instance of NoticeboardUser

+ * + * @param nbUser The instance of NoticeboardUser to delete. + */ + public void removeUser(NoticeboardUser nbUser); + + + + /** + *

Performs a check on the flag indicated by flag + * In this noticeboard tool, there are 3 possible flags: + *

  • defineLater
  • + *
  • contentInUse
  • + *
  • runOffline
  • + *
    Returns true if the flag is set, false otherwise

    + * + * @param contentId The tool content id + * @param flag The flag to check, can take the following set of values (defineLater, contentInUse, runOffline) + * @return Returns true if flag is set, false otherwise + */ + public boolean isFlagSet(Long contentId, int flag); + }