Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/service/INoticeboardService.java =================================================================== diff -u -r51baa92eb2330b3d5bed3d2a2c4cd622e665b83d -r6cce13e2c656d9cab6d0fc4a133245be0e2299c0 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/service/INoticeboardService.java (.../INoticeboardService.java) (revision 51baa92eb2330b3d5bed3d2a2c4cd622e665b83d) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/service/INoticeboardService.java (.../INoticeboardService.java) (revision 6cce13e2c656d9cab6d0fc4a133245be0e2299c0) @@ -23,6 +23,7 @@ import org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent; import org.lamsfoundation.lams.tool.noticeboard.NoticeboardSession; +; /** * Defines the contract that the tool service provider must follow @@ -31,51 +32,97 @@ */ public interface INoticeboardService { - /** - * Return the NoticeboardContent object that has id nbContentId. - * - * @param nbContentid The id of the requested NoticeboardContent object - * @return NoticeboardContent object or null if not found - */ - + //=================================================================== + // NoticeboardContent access methods + //=================================================================== + + /** + *

Retrieve an instance of NoticeboardContent with the given + * identifier uid

+ * @param uid The given unique identifier of the NoticeboardContent instance + * @return an instance of NoticeboardContent + */ + public NoticeboardContent retrieveNoticeboardByUID(Long uid); + + /** + *

Returns the persistent instance of NoticeboardContent + * with the given tool session id nbSessionId, returns null if not found. + * + * @param nbSessionId The tool session id + * @return a persistent instance of NoticeboardContent or null if not found. + */ + public NoticeboardContent retrieveNoticeboardBySessionID(Long nbSessionId); + + /** + *

Retrieve an instance of NoticeboardContent with the given + * tool content id nbContentId

+ * @param nbContentId The tool content id + * @return an instance of NoticeboardContent + */ public NoticeboardContent retrieveNoticeboard(Long nbContentId); - /** - * Updates the values of the NoticeboardContent object. - * - * @param nbContent The NoticeboardContent object to update - * - */ + + /** + *

Update the given persistent instance of NoticeboardContent.

+ * + * @param nbContent The instance of NoticeboardContent to persist. + */ public void updateNoticeboard(NoticeboardContent nbContent); /** - * Save the content of the NoticeboardContent object + *

Persist the given persistent instance of NoticeboardContent.

* - * @param nbContent the NoticeboardContent object to persist - */ + * @param nbContent The instance of NoticeboardContent to persist. + */ public void saveNoticeboard(NoticeboardContent nbContent); + /** + *

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

+ * + * @param nbContent The instance of NoticeboardContent in which corresponding instances of NoticeboardSession should be deleted. + */ + public void removeNoticeboardSessions(NoticeboardContent nbContent); + /** - * Removes the NoticeboardSessions which is associated with the particular - * NoticeboardContent object. + *

Delete the given instance of NoticeboardContent with the + * given tool content id nbContentId + * + * @param nbContentId The tool content Id. + */ + public void removeNoticeboard(Long nbContentId); + + /** + *

Delete the given instance of NoticeboardContent

+ * + * @param nbContent The instance of NoticeboardContent to delete. + */ + public void removeNoticeboard(NoticeboardContent nbContent); + + + //=================================================================== + // NoticeboardSession access methods + //=================================================================== + /** + *

Return the persistent instance of a NoticeboardSession + * with the given tool session id nbSessionId, + * returns null if not found.

* - * @param nbContent The noticeboard content in which its corresponding sessions - * must be removed - * + * @param nbSessionId The tool session id + * @return the persistent instance of a NoticeboardSession or null if not found. */ + public NoticeboardSession retrieveNoticeboardSession(Long nbSessionId); - public void removeNoticeboardSessions(NoticeboardContent nbContent); - /** - * Remove the noticeboard object with content id of - * that specified in the argument. + *

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

* - * @param nbContentid The id of the requested noticeboard object - * - */ - public void removeNoticeboard(Long nbContentId); + * @param uid an identifier for the NoticeboardSession object. + * @return the persistent instance of a NoticeboardSession or null if not found + */ + public NoticeboardSession retrieveNoticeboardSessionByUID(Long uid); /** * Persists the new NoticeboardSession object into the database. @@ -85,4 +132,33 @@ public void saveNoticeboardSession(NoticeboardSession nbSession); + /** + * Updates the values of the noticeboard session. + * @param nbSession + */ + public void updateNoticeboardSession(NoticeboardSession nbSession); + + /** + * Remove the noticeboard session object with session id of + * that specified in the argument. + * + * @param nbSessionId The id of the requested noticeboard object + * + */ + public void removeSession(Long nbSessionId); + + /** + *

Delete the given instance of NoticeboardSession

+ * + * @param nbSession The instance of NoticeboardSession to delete. + */ + public void removeSession(NoticeboardSession nbSession); + + /** + *

Delete the given instance of NoticeboardSession with the + * given identifier uid + * + * @param uid an identifier for the NoticeboardSession instance. + */ + public void removeSessionByUID(Long uid); }