Class SubscribeServiceImpl

  • All Implemented Interfaces:
    SubscribeService

    public class SubscribeServiceImpl
    extends Object
    implements SubscribeService
    Class defining methods for sending new item e-mail alerts to users
    Version:
    $Revision$
    Author:
    Robert Tansley
    • Field Detail

      • subscriptionDAO

        @Autowired(required=true)
        protected SubscriptionDAO subscriptionDAO
      • authorizeService

        @Autowired(required=true)
        protected AuthorizeService authorizeService
      • collectionService

        @Autowired(required=true)
        protected CollectionService collectionService
    • Constructor Detail

      • SubscribeServiceImpl

        protected SubscribeServiceImpl()
    • Method Detail

      • findAll

        public List<Subscription> findAll​(Context context)
                                   throws SQLException
        Description copied from interface: SubscribeService
        Subscribe an e-person to a collection. An e-mail will be sent every day a new item appears in the collection.
        Specified by:
        findAll in interface SubscribeService
        Parameters:
        context - DSpace context
        Returns:
        list of Subscription objects
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • subscribe

        public void subscribe​(Context context,
                              EPerson eperson,
                              Collection collection)
                       throws SQLException,
                              AuthorizeException
        Description copied from interface: SubscribeService
        Subscribe an e-person to a collection. An e-mail will be sent every day a new item appears in the collection.
        Specified by:
        subscribe in interface SubscribeService
        Parameters:
        context - DSpace context
        eperson - EPerson to subscribe
        collection - Collection to subscribe to
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
        AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
      • unsubscribe

        public void unsubscribe​(Context context,
                                EPerson eperson,
                                Collection collection)
                         throws SQLException,
                                AuthorizeException
        Description copied from interface: SubscribeService
        Unsubscribe an e-person to a collection. Passing in null for the collection unsubscribes the e-person from all collections they are subscribed to.
        Specified by:
        unsubscribe in interface SubscribeService
        Parameters:
        context - DSpace context
        eperson - EPerson to unsubscribe
        collection - Collection to unsubscribe from
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
        AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
      • getSubscriptions

        public List<Subscription> getSubscriptions​(Context context,
                                                   EPerson eperson)
                                            throws SQLException
        Description copied from interface: SubscribeService
        Find out which collections an e-person is subscribed to
        Specified by:
        getSubscriptions in interface SubscribeService
        Parameters:
        context - DSpace context
        eperson - EPerson
        Returns:
        array of collections e-person is subscribed to
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • getAvailableSubscriptions

        public List<Collection> getAvailableSubscriptions​(Context context)
                                                   throws SQLException
        Description copied from interface: SubscribeService
        Find out which collections the currently logged in e-person can subscribe to
        Specified by:
        getAvailableSubscriptions in interface SubscribeService
        Parameters:
        context - DSpace context
        Returns:
        array of collections the currently logged in e-person can subscribe to
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • isSubscribed

        public boolean isSubscribed​(Context context,
                                    EPerson eperson,
                                    Collection collection)
                             throws SQLException
        Description copied from interface: SubscribeService
        Is that e-person subscribed to that collection?
        Specified by:
        isSubscribed in interface SubscribeService
        Parameters:
        context - DSpace context
        eperson - find out if this e-person is subscribed
        collection - find out if subscribed to this collection
        Returns:
        true if they are subscribed
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • deleteByCollection

        public void deleteByCollection​(Context context,
                                       Collection collection)
                                throws SQLException
        Description copied from interface: SubscribeService
        Delete subscription by collection.
        Specified by:
        deleteByCollection in interface SubscribeService
        Parameters:
        context - DSpace context
        collection - find out if subscribed to this collection
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • deleteByEPerson

        public void deleteByEPerson​(Context context,
                                    EPerson ePerson)
                             throws SQLException
        Description copied from interface: SubscribeService
        Delete subscription by eperson (subscriber).
        Specified by:
        deleteByEPerson in interface SubscribeService
        Parameters:
        context - DSpace context
        ePerson - find out if this e-person is subscribed
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.