* @return the subscription context to use or <code>null</code> if the
* identity associated to the request is not allowed to be notified
* @see #canSubscribeForAssessmentNotification(Identity, ICourse)
*/
protected SubscriptionContext getAssessmentSubscriptionContext(Identity ident, ICourse course) {
SubscriptionContext sctx = null;
if (ident == null || canSubscribeForAssessmentNotification(ident, course)) {
// Creates a new SubscriptionContext only if not found into cache
Long courseId = course.getResourceableId();
synchronized (subsContexts) { //o_clusterOK by:ld - no problem to have independent subsContexts caches for each cluster node
sctx = subsContexts.get(courseId);
if (sctx == null) {
// a subscription context showing to the root node (the course's root
// node is started when clicking such a notification)
CourseNode cn = course.getRunStructure().getRootNode();
CourseEnvironment ce = course.getCourseEnvironment();
//FIXME:fg:b little problem is that the assessment tool and the course are not "the same" anymore, that is you can open the same course twice in the
// dynamic tabs by a) klicking e.g. via repo, and b via notifications link to the assementtool
sctx = new SubscriptionContext(CourseModule.ORES_COURSE_ASSESSMENT, ce.getCourseResourceableId(), cn.getIdent());
subsContexts.put(courseId, sctx);
}
}
}