Interface SubscribeService

  • All Known Implementing Classes:
    SubscribeServiceImpl

    public interface SubscribeService
    Service interface class for the Subscription object. The implementation of this class is responsible for all business logic calls for the Subscription object and is autowired by spring Class defining methods for sending new item e-mail alerts to users
    Author:
    kevinvandevelde at atmire.com
    • Method Detail

      • findAll

        List<Subscription> findAll​(Context context)
                            throws SQLException
        Subscribe an e-person to a collection. An e-mail will be sent every day a new item appears in the collection.
        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

        void subscribe​(Context context,
                       EPerson eperson,
                       Collection collection)
                throws SQLException,
                       AuthorizeException
        Subscribe an e-person to a collection. An e-mail will be sent every day a new item appears in the collection.
        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

        void unsubscribe​(Context context,
                         EPerson eperson,
                         Collection collection)
                  throws SQLException,
                         AuthorizeException
        Unsubscribe an e-person to a collection. Passing in null for the collection unsubscribes the e-person from all collections they are subscribed to.
        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

        List<Subscription> getSubscriptions​(Context context,
                                            EPerson eperson)
                                     throws SQLException
        Find out which collections an e-person is subscribed to
        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

        List<Collection> getAvailableSubscriptions​(Context context)
                                            throws SQLException
        Find out which collections the currently logged in e-person can subscribe to
        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.
      • getAvailableSubscriptions

        List<Collection> getAvailableSubscriptions​(Context context,
                                                   EPerson eperson)
                                            throws SQLException
        Find out which collections an e-person can subscribe to
        Parameters:
        context - DSpace context
        eperson - EPerson
        Returns:
        array of collections e-person can subscribe to
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • isSubscribed

        boolean isSubscribed​(Context context,
                             EPerson eperson,
                             Collection collection)
                      throws SQLException
        Is that e-person subscribed to that collection?
        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

        void deleteByCollection​(Context context,
                                Collection collection)
                         throws SQLException
        Delete subscription by collection.
        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

        void deleteByEPerson​(Context context,
                             EPerson ePerson)
                      throws SQLException
        Delete subscription by eperson (subscriber).
        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.