com.jamasoftware.contour.dao
Interface SubscriptionDao


public interface SubscriptionDao


Method Summary
 void deleteSubscription(Subscription sub)
           
 java.util.List<Role> getDirectlySubscribedGroups(java.lang.Integer scopeId, java.lang.Integer refId)
           
 java.util.List<User> getDirectlySubscribedUsers(java.lang.Integer scopeId, java.lang.Integer refId, java.lang.Boolean selfSubscribed)
           
 java.util.List<Role> getSubscribedGroupsToNotify(java.lang.Integer docId, java.lang.Integer parentDocId, java.lang.Integer docProjectId)
           
 java.util.List<java.lang.Integer> getSubscribedRevisionItemIds(java.lang.Integer revisionId, java.lang.Integer userId)
          Obtains the ids of all Revision_Items that the given user is following for the given revision.
 java.util.List<User> getSubscribedUsersToNotify(java.lang.Integer docId, java.lang.Integer parentDocId, java.lang.Integer projectId)
           
 java.util.List<Subscription> getSubscribersSubscribedTo(java.util.Map<java.lang.Integer,java.lang.Integer> scopeMap, boolean directSubscriptionsOnly)
           
 Subscription getSubscription(java.lang.Integer subId)
           
 java.util.List<Subscription> getSubscriptionBasedOnMeta(com.jamasoftware.contour.service.dto.Subscriber subscriber, java.lang.Integer scope, java.lang.Integer refId, boolean directSubscriptionsOnly)
           
 java.util.List<Subscription> getSubscriptionBasedOnMeta(com.jamasoftware.contour.service.dto.Subscriber subscriber, java.lang.Integer scope, java.lang.Integer refId, java.lang.Integer contextScope, java.lang.Integer contextId, boolean directSubscriptionsOnly)
           
 java.util.List<java.lang.Integer> getSubscriptionIdsForScopeAndRef(java.lang.Integer scopeId, java.lang.Integer refId)
           
 java.util.List<Subscription> getSubscriptionList()
           
 java.util.List<Subscription> getSubscriptionListBySubscriber(com.jamasoftware.contour.service.dto.Subscriber subscriber)
          Gets the list of regular subscriptions (review subscriptions excluded) for a user.
 java.util.List<Subscription> getSubscriptionListBySubscriber(com.jamasoftware.contour.service.dto.Subscriber subscriber, boolean includeReviewSubscription)
          Gets the list of subscriptions for a user.
 java.util.List<Subscription> getSubscriptionListBySubscriberAndProject(com.jamasoftware.contour.service.dto.Subscriber subscriber, java.lang.Integer projectId)
           
 java.util.List<Subscription> getSubscriptionsForItemsInContext(java.lang.Integer contextScopeId, java.lang.Integer contextId, java.lang.Integer userId)
           
 java.util.List<Subscription> getSubscriptionsForScopeIds(java.lang.Integer scope, java.util.List<java.lang.Integer> ids)
           
 java.util.List<Subscription> getSubscriptionsForScopeIdsAndSubscriber(java.lang.Integer scope, java.util.List<java.lang.Integer> ids, com.jamasoftware.contour.service.dto.Subscriber subscriber)
           
 java.util.List<Subscription> getSubscriptionsForScopeIdsAndSubscriber(java.lang.Integer scope, java.util.List<java.lang.Integer> ids, com.jamasoftware.contour.service.dto.Subscriber subscriber, java.lang.Integer contextScope, java.lang.Integer contextId)
           
 java.util.List<User_JobSchedule> getUserJobSchedulesByJob(java.lang.Integer jobId)
           
 java.util.List<User_JobSchedule> getUserJobSchedulesByUser(java.lang.Integer userId)
           
 java.util.List<User> getUsersSubscribedToRevisionItem(java.lang.Integer revisionItemId)
           
 java.util.List<User> getUsersWithImmediateSubscriptionsFromGroup(java.lang.Integer roleId)
           
 boolean isSubscribedTo(com.jamasoftware.contour.service.dto.Subscriber subscriber, java.lang.Integer scope, java.lang.Integer refId, boolean directSubscriptionsOnly)
           
 boolean isSubscribedTo(com.jamasoftware.contour.service.dto.Subscriber subscriber, java.lang.Integer scope, java.lang.Integer refId, java.lang.Integer contextScopeId, java.lang.Integer contextId, boolean directSubscriptionsOnly)
           
 void saveSubscription(Subscription sub)
           
 

Method Detail

getSubscription

Subscription getSubscription(java.lang.Integer subId)

getSubscriptionList

java.util.List<Subscription> getSubscriptionList()

getSubscriptionListBySubscriber

java.util.List<Subscription> getSubscriptionListBySubscriber(com.jamasoftware.contour.service.dto.Subscriber subscriber)
Gets the list of regular subscriptions (review subscriptions excluded) for a user.

Parameters:
userId - the ID of the user.
Returns:
list of subscriptions.

getSubscriptionListBySubscriberAndProject

java.util.List<Subscription> getSubscriptionListBySubscriberAndProject(com.jamasoftware.contour.service.dto.Subscriber subscriber,
                                                                       java.lang.Integer projectId)

getSubscriptionListBySubscriber

java.util.List<Subscription> getSubscriptionListBySubscriber(com.jamasoftware.contour.service.dto.Subscriber subscriber,
                                                             boolean includeReviewSubscription)
Gets the list of subscriptions for a user.

Parameters:
userId - the ID of the user.
includeReviewSubscription - whether to include the review item subscriptions.
Returns:
list of subscriptions.

getSubscribersSubscribedTo

java.util.List<Subscription> getSubscribersSubscribedTo(java.util.Map<java.lang.Integer,java.lang.Integer> scopeMap,
                                                        boolean directSubscriptionsOnly)

getSubscriptionIdsForScopeAndRef

java.util.List<java.lang.Integer> getSubscriptionIdsForScopeAndRef(java.lang.Integer scopeId,
                                                                   java.lang.Integer refId)

isSubscribedTo

boolean isSubscribedTo(com.jamasoftware.contour.service.dto.Subscriber subscriber,
                       java.lang.Integer scope,
                       java.lang.Integer refId,
                       boolean directSubscriptionsOnly)

isSubscribedTo

boolean isSubscribedTo(com.jamasoftware.contour.service.dto.Subscriber subscriber,
                       java.lang.Integer scope,
                       java.lang.Integer refId,
                       java.lang.Integer contextScopeId,
                       java.lang.Integer contextId,
                       boolean directSubscriptionsOnly)

getUserJobSchedulesByJob

java.util.List<User_JobSchedule> getUserJobSchedulesByJob(java.lang.Integer jobId)

getUserJobSchedulesByUser

java.util.List<User_JobSchedule> getUserJobSchedulesByUser(java.lang.Integer userId)

saveSubscription

void saveSubscription(Subscription sub)

deleteSubscription

void deleteSubscription(Subscription sub)

getSubscriptionBasedOnMeta

java.util.List<Subscription> getSubscriptionBasedOnMeta(com.jamasoftware.contour.service.dto.Subscriber subscriber,
                                                        java.lang.Integer scope,
                                                        java.lang.Integer refId,
                                                        boolean directSubscriptionsOnly)

getSubscriptionBasedOnMeta

java.util.List<Subscription> getSubscriptionBasedOnMeta(com.jamasoftware.contour.service.dto.Subscriber subscriber,
                                                        java.lang.Integer scope,
                                                        java.lang.Integer refId,
                                                        java.lang.Integer contextScope,
                                                        java.lang.Integer contextId,
                                                        boolean directSubscriptionsOnly)

getSubscribedUsersToNotify

java.util.List<User> getSubscribedUsersToNotify(java.lang.Integer docId,
                                                java.lang.Integer parentDocId,
                                                java.lang.Integer projectId)

getSubscribedGroupsToNotify

java.util.List<Role> getSubscribedGroupsToNotify(java.lang.Integer docId,
                                                 java.lang.Integer parentDocId,
                                                 java.lang.Integer docProjectId)

getDirectlySubscribedUsers

java.util.List<User> getDirectlySubscribedUsers(java.lang.Integer scopeId,
                                                java.lang.Integer refId,
                                                java.lang.Boolean selfSubscribed)

getDirectlySubscribedGroups

java.util.List<Role> getDirectlySubscribedGroups(java.lang.Integer scopeId,
                                                 java.lang.Integer refId)

getUsersWithImmediateSubscriptionsFromGroup

java.util.List<User> getUsersWithImmediateSubscriptionsFromGroup(java.lang.Integer roleId)

getSubscribedRevisionItemIds

java.util.List<java.lang.Integer> getSubscribedRevisionItemIds(java.lang.Integer revisionId,
                                                               java.lang.Integer userId)
Obtains the ids of all Revision_Items that the given user is following for the given revision. Note that subscriptions are based on current Document ids and are scoped at the Review level, so this dao method traverses the object graph (in an efficient way) to obtain revision items that point to origin documents that are what the Subscription ref ids point to, in the review context scope for the review associated with the given revision id, and only for subscriptions associated with the given user id.

Parameters:
revisionId - The id of a Revision
userId - The id of a User
Returns:
The list of Revision_Item ids that this User is following for the given Revision

getUsersSubscribedToRevisionItem

java.util.List<User> getUsersSubscribedToRevisionItem(java.lang.Integer revisionItemId)

getSubscriptionsForItemsInContext

java.util.List<Subscription> getSubscriptionsForItemsInContext(java.lang.Integer contextScopeId,
                                                               java.lang.Integer contextId,
                                                               java.lang.Integer userId)

getSubscriptionsForScopeIds

java.util.List<Subscription> getSubscriptionsForScopeIds(java.lang.Integer scope,
                                                         java.util.List<java.lang.Integer> ids)

getSubscriptionsForScopeIdsAndSubscriber

java.util.List<Subscription> getSubscriptionsForScopeIdsAndSubscriber(java.lang.Integer scope,
                                                                      java.util.List<java.lang.Integer> ids,
                                                                      com.jamasoftware.contour.service.dto.Subscriber subscriber)

getSubscriptionsForScopeIdsAndSubscriber

java.util.List<Subscription> getSubscriptionsForScopeIdsAndSubscriber(java.lang.Integer scope,
                                                                      java.util.List<java.lang.Integer> ids,
                                                                      com.jamasoftware.contour.service.dto.Subscriber subscriber,
                                                                      java.lang.Integer contextScope,
                                                                      java.lang.Integer contextId)


Copyright (c) 2010 Jama Software, Inc. All Rights Reserved.