Package org.dspace.eperson.service
Interface SubscribeService
-
- All Known Implementing Classes:
SubscribeServiceImpl
public interface SubscribeServiceService 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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteByCollection(Context context, Collection collection)Delete subscription by collection.voiddeleteByEPerson(Context context, EPerson ePerson)Delete subscription by eperson (subscriber).List<Subscription>findAll(Context context)Subscribe an e-person to a collection.List<Collection>getAvailableSubscriptions(Context context)Find out which collections the currently logged in e-person can subscribe toList<Collection>getAvailableSubscriptions(Context context, EPerson eperson)Find out which collections an e-person can subscribe toList<Subscription>getSubscriptions(Context context, EPerson eperson)Find out which collections an e-person is subscribed tobooleanisSubscribed(Context context, EPerson eperson, Collection collection)Is that e-person subscribed to that collection?voidsubscribe(Context context, EPerson eperson, Collection collection)Subscribe an e-person to a collection.voidunsubscribe(Context context, EPerson eperson, Collection collection)Unsubscribe an e-person to a collection.
-
-
-
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 contexteperson- EPerson to subscribecollection- 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 innullfor the collection unsubscribes the e-person from all collections they are subscribed to.- Parameters:
context- DSpace contexteperson- EPerson to unsubscribecollection- 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 contexteperson- 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 contexteperson- 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 contexteperson- find out if this e-person is subscribedcollection- find out if subscribed to this collection- Returns:
trueif 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 contextcollection- 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 contextePerson- find out if this e-person is subscribed- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
-