Interface SubscriptionService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void follow​(java.lang.String userId, java.lang.String userToFollow)
      Follows a user.
      boolean follows​(java.lang.String userId, java.lang.String userToFollow)
      Returns if the user follows to the given other user.
      PagingFollowingResults getFollowers​(java.lang.String userId, org.alfresco.query.PagingRequest pagingRequest)
      Returns a list of users that follow the given user.
      int getFollowersCount​(java.lang.String userId)
      Returns how many users follow the given user.
      PagingFollowingResults getFollowing​(java.lang.String userId, org.alfresco.query.PagingRequest pagingRequest)
      Returns a list of users that the given user follows.
      int getFollowingCount​(java.lang.String userId)
      Returns how many users the given user follows.
      int getSubscriptionCount​(java.lang.String userId, SubscriptionItemTypeEnum type)
      Returns how many nodes the given user has subscribed to.
      PagingSubscriptionResults getSubscriptions​(java.lang.String userId, SubscriptionItemTypeEnum type, org.alfresco.query.PagingRequest pagingRequest)
      Returns the nodes a user has subscribed to.
      boolean hasSubscribed​(java.lang.String userId, org.alfresco.service.cmr.repository.NodeRef node)
      Returns if the user has subscribed to the given node.
      boolean isActive()
      Returns if subscription are enabled for this system.
      boolean isSubscriptionListPrivate​(java.lang.String userId)
      Returns if the subscription list of the given user is set to private.
      void setSubscriptionListPrivate​(java.lang.String userId, boolean isPrivate)
      Sets or unsets the subscription list of the given user to private.
      void subscribe​(java.lang.String userId, org.alfresco.service.cmr.repository.NodeRef node)
      Subscribes to a node.
      void unfollow​(java.lang.String userId, java.lang.String userToUnfollow)
      Unfollows a user.
      void unsubscribe​(java.lang.String userId, org.alfresco.service.cmr.repository.NodeRef node)
      Unsubscribes from a node.
    • Method Detail

      • getSubscriptions

        @NotAuditable
        PagingSubscriptionResults getSubscriptions​(java.lang.String userId,
                                                   SubscriptionItemTypeEnum type,
                                                   org.alfresco.query.PagingRequest pagingRequest)
        Returns the nodes a user has subscribed to.
        Parameters:
        userId - the id of the user
        type - the type of the nodes
        pagingRequest - paging details
        Throws:
        PrivateSubscriptionListException - if the subscription list is private and the calling user is not allowed to see it
      • getSubscriptionCount

        @NotAuditable
        int getSubscriptionCount​(java.lang.String userId,
                                 SubscriptionItemTypeEnum type)
        Returns how many nodes the given user has subscribed to.
        Parameters:
        userId - the id of the user
        type - the type of the nodes
      • subscribe

        @Auditable(parameters={"userId","node"})
        void subscribe​(java.lang.String userId,
                       org.alfresco.service.cmr.repository.NodeRef node)
        Subscribes to a node.
        Parameters:
        userId - id of the user
        node - the node
      • unsubscribe

        @Auditable(parameters={"userId","node"})
        void unsubscribe​(java.lang.String userId,
                         org.alfresco.service.cmr.repository.NodeRef node)
        Unsubscribes from a node.
        Parameters:
        userId - id of the user
        node - the node
      • hasSubscribed

        @NotAuditable
        boolean hasSubscribed​(java.lang.String userId,
                              org.alfresco.service.cmr.repository.NodeRef node)
        Returns if the user has subscribed to the given node.
        Parameters:
        userId - id of the user
        node - the node
      • getFollowing

        @NotAuditable
        PagingFollowingResults getFollowing​(java.lang.String userId,
                                            org.alfresco.query.PagingRequest pagingRequest)
        Returns a list of users that the given user follows.
        Parameters:
        userId - id of the user
        pagingRequest - paging details
        Throws:
        PrivateSubscriptionListException - if the subscription list is private and the calling user is not allowed to see it
      • getFollowers

        @NotAuditable
        PagingFollowingResults getFollowers​(java.lang.String userId,
                                            org.alfresco.query.PagingRequest pagingRequest)
        Returns a list of users that follow the given user.
        Parameters:
        userId - id of the user
        pagingRequest - paging details
      • getFollowingCount

        @NotAuditable
        int getFollowingCount​(java.lang.String userId)
        Returns how many users the given user follows.
        Parameters:
        userId - the id of the user
      • getFollowersCount

        @NotAuditable
        int getFollowersCount​(java.lang.String userId)
        Returns how many users follow the given user.
        Parameters:
        userId - the id of the user
      • follow

        @Auditable(parameters={"userId","userToFollow"})
        void follow​(java.lang.String userId,
                    java.lang.String userToFollow)
        Follows a user.
        Parameters:
        userId - the id of the user
        userToFollow - the id of the user to follow
      • unfollow

        @Auditable(parameters={"userId","userToUnfollow"})
        void unfollow​(java.lang.String userId,
                      java.lang.String userToUnfollow)
        Unfollows a user.
        Parameters:
        userId - the id of the user
        userToUnfollow - the id of the user to unfollow
      • follows

        @NotAuditable
        boolean follows​(java.lang.String userId,
                        java.lang.String userToFollow)
        Returns if the user follows to the given other user.
        Parameters:
        userId - id of the user
        userToFollow - the id of the other user
      • setSubscriptionListPrivate

        @Auditable(parameters={"userId","isPrivate"})
        void setSubscriptionListPrivate​(java.lang.String userId,
                                        boolean isPrivate)
        Sets or unsets the subscription list of the given user to private.
        Parameters:
        userId - the id of the user
        isPrivate - true - set list private, false - set list public
      • isSubscriptionListPrivate

        @NotAuditable
        boolean isSubscriptionListPrivate​(java.lang.String userId)
        Returns if the subscription list of the given user is set to private.
        Parameters:
        userId - the id of the user
      • isActive

        @NotAuditable
        boolean isActive()
        Returns if subscription are enabled for this system.
        Specified by:
        isActive in interface ActivateableBean
        Returns:
        true if this bean is active