@Test public void testSubscribe() { Long courseId = courseMock.getResourceableId(); notificationServiceImpl.subscribe(new NotificationSubscriptionContext(identity, ForumNotificationTypeHandler.FORUM_SOURCE_TYPE, new Long(123), Publisher.ContextType.COURSE, courseId, null)); }
@Override public Subscription subscribe(NotificationSubscriptionContext subscriptionContext) { if (isSubscribed(subscriptionContext)) { return subscriptionDelegate.getSubscription(subscriptionContext); } else { return subscriptionDelegate.createAndSaveSubscription(subscriptionContext); } }
NotificationServiceImpl extends CoreBaseService<NotificationServiceMetric<NotificationServiceContext>, NotificationServiceContext> implements
        NotificationService { @Override public Subscription subscribe(NotificationSubscriptionContext subscriptionContext) { if (isSubscribed(subscriptionContext)) { return subscriptionDelegate.getSubscription(subscriptionContext); } else { return subscriptionDelegate.createAndSaveSubscription(subscriptionContext); } } }
NotificationServiceImpl extends CoreBaseService<NotificationServiceMetric<NotificationServiceContext>, NotificationServiceContext> implements
        NotificationService { @Override public Subscription subscribe(NotificationSubscriptionContext subscriptionContext) { if (isSubscribed(subscriptionContext)) { return subscriptionDelegate.getSubscription(subscriptionContext); } else { return subscriptionDelegate.createAndSaveSubscription(subscriptionContext); } }  }
NotificationServiceImpl extends CoreBaseService<NotificationServiceMetric<NotificationServiceContext>, NotificationServiceContext> implements
        NotificationService { @Override public Subscription subscribe(NotificationSubscriptionContext subscriptionContext) { if (isSubscribed(subscriptionContext)) { return subscriptionDelegate.getSubscription(subscriptionContext); } else { return subscriptionDelegate.createAndSaveSubscription(subscriptionContext); } }  void setNotifyDelegate(NotifyDelegate notifyDelegate); @Override Subscription subscribe(NotificationSubscriptionContext subscriptionContext); @Override List<Subscription> getSubscriptions(Identity identity); @Override @Retryable // LD reviewed: should use Propagation.REQUIRES_NEW, else it is not possible to be successful in case of retry // @Transactional(propagation = Propagation.REQUIRES_NEW) int publishEvent(PublishEventTO publishEventTO); @Deprecated @Override NotifyStatistics notifySubscribers(); @Override NotifyStatistics notifySubscriber(Long subscriberId); @Override List<Long> getSubscribersIds(); @Override void unsubscribe(NotificationSubscriptionContext subscriptionContext); @Override void unsubscribe(Subscription subscription); @Override boolean isSubscribed(NotificationSubscriptionContext subscriptionContext); @Override List<UserNotificationEventTO> getNews(Identity identity, DateFilter dateFilter); @Override List<NotificationSubscriptionContext> getNotificationSubscriptionContexts(Long subscriberId); @Override List<Long> getAllSubscriberKeys(); @Override void invalidateUnaccesibleSubscriptions(List<NotificationSubscriptionContext> notificationSubscriptionContexts); @Override boolean isNotificationIntervalFor(Identity identity, Subscriber.NotificationInterval notificationInterval); @Override void setNotificationIntervalFor(Identity identity, Subscriber.NotificationInterval notificationInterval); @Override void removePublishers(Set<Long> contextIds); @Override void removeOldEvents(Date notificationNewsDate); @Override void deleteInvalidSubscribers(); @Override void startNotificationJob(); @Override void finishNotificationJob(); }
NotificationServiceImpl extends CoreBaseService<NotificationServiceMetric<NotificationServiceContext>, NotificationServiceContext> implements
        NotificationService { @Override public Subscription subscribe(NotificationSubscriptionContext subscriptionContext) { if (isSubscribed(subscriptionContext)) { return subscriptionDelegate.getSubscription(subscriptionContext); } else { return subscriptionDelegate.createAndSaveSubscription(subscriptionContext); } }  void setNotifyDelegate(NotifyDelegate notifyDelegate); @Override Subscription subscribe(NotificationSubscriptionContext subscriptionContext); @Override List<Subscription> getSubscriptions(Identity identity); @Override @Retryable // LD reviewed: should use Propagation.REQUIRES_NEW, else it is not possible to be successful in case of retry // @Transactional(propagation = Propagation.REQUIRES_NEW) int publishEvent(PublishEventTO publishEventTO); @Deprecated @Override NotifyStatistics notifySubscribers(); @Override NotifyStatistics notifySubscriber(Long subscriberId); @Override List<Long> getSubscribersIds(); @Override void unsubscribe(NotificationSubscriptionContext subscriptionContext); @Override void unsubscribe(Subscription subscription); @Override boolean isSubscribed(NotificationSubscriptionContext subscriptionContext); @Override List<UserNotificationEventTO> getNews(Identity identity, DateFilter dateFilter); @Override List<NotificationSubscriptionContext> getNotificationSubscriptionContexts(Long subscriberId); @Override List<Long> getAllSubscriberKeys(); @Override void invalidateUnaccesibleSubscriptions(List<NotificationSubscriptionContext> notificationSubscriptionContexts); @Override boolean isNotificationIntervalFor(Identity identity, Subscriber.NotificationInterval notificationInterval); @Override void setNotificationIntervalFor(Identity identity, Subscriber.NotificationInterval notificationInterval); @Override void removePublishers(Set<Long> contextIds); @Override void removeOldEvents(Date notificationNewsDate); @Override void deleteInvalidSubscribers(); @Override void startNotificationJob(); @Override void finishNotificationJob();  }