Package org.dspace.eperson
Class SubscribeServiceImpl
- java.lang.Object
-
- org.dspace.eperson.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 Summary
Fields Modifier and Type Field Description protected AuthorizeServiceauthorizeServiceprotected CollectionServicecollectionServiceprotected SubscriptionDAOsubscriptionDAO
-
Constructor Summary
Constructors Modifier Constructor Description protectedSubscribeServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Field Detail
-
subscriptionDAO
@Autowired(required=true) protected SubscriptionDAO subscriptionDAO
-
authorizeService
@Autowired(required=true) protected AuthorizeService authorizeService
-
collectionService
@Autowired(required=true) protected CollectionService collectionService
-
-
Method Detail
-
findAll
public List<Subscription> findAll(Context context) throws SQLException
Description copied from interface:SubscribeServiceSubscribe an e-person to a collection. An e-mail will be sent every day a new item appears in the collection.- Specified by:
findAllin interfaceSubscribeService- 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:SubscribeServiceSubscribe an e-person to a collection. An e-mail will be sent every day a new item appears in the collection.- Specified by:
subscribein interfaceSubscribeService- 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
public void unsubscribe(Context context, EPerson eperson, Collection collection) throws SQLException, AuthorizeException
Description copied from interface:SubscribeServiceUnsubscribe an e-person to a collection. Passing innullfor the collection unsubscribes the e-person from all collections they are subscribed to.- Specified by:
unsubscribein interfaceSubscribeService- 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
public List<Subscription> getSubscriptions(Context context, EPerson eperson) throws SQLException
Description copied from interface:SubscribeServiceFind out which collections an e-person is subscribed to- Specified by:
getSubscriptionsin interfaceSubscribeService- 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
public List<Collection> getAvailableSubscriptions(Context context) throws SQLException
Description copied from interface:SubscribeServiceFind out which collections the currently logged in e-person can subscribe to- Specified by:
getAvailableSubscriptionsin interfaceSubscribeService- 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
public List<Collection> getAvailableSubscriptions(Context context, EPerson eperson) throws SQLException
Description copied from interface:SubscribeServiceFind out which collections an e-person can subscribe to- Specified by:
getAvailableSubscriptionsin interfaceSubscribeService- 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
public boolean isSubscribed(Context context, EPerson eperson, Collection collection) throws SQLException
Description copied from interface:SubscribeServiceIs that e-person subscribed to that collection?- Specified by:
isSubscribedin interfaceSubscribeService- 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
public void deleteByCollection(Context context, Collection collection) throws SQLException
Description copied from interface:SubscribeServiceDelete subscription by collection.- Specified by:
deleteByCollectionin interfaceSubscribeService- 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
public void deleteByEPerson(Context context, EPerson ePerson) throws SQLException
Description copied from interface:SubscribeServiceDelete subscription by eperson (subscriber).- Specified by:
deleteByEPersonin interfaceSubscribeService- 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.
-
-