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 SubscriptionaddSubscriptionParameter(Context context, Integer id, SubscriptionParameter subscriptionParameter)Adds a parameter to a subscriptionLongcountAll(Context context)Counts all subscriptionsLongcountByEPersonAndDSO(Context context, EPerson ePerson, DSpaceObject dSpaceObject)Counts all subscriptions by ePerson and DSOLongcountSubscriptionsByEPerson(Context context, EPerson ePerson)Counts all subscriptions by ePersonvoiddeleteByDspaceObject(Context context, DSpaceObject dSpaceObject)Delete subscription by collection.voiddeleteByEPerson(Context context, EPerson ePerson)Delete subscription by eperson (subscriber).voiddeleteSubscription(Context context, Subscription subscription)Deletes a subscriptionList<Subscription>findAll(Context context, String resourceType, Integer limit, Integer offset)Subscribe an e-person to a collection.List<Subscription>findAllSubscriptionsBySubscriptionTypeAndFrequency(Context context, String subscriptionType, String frequencyValue)Finds all subscriptions by subscriptionType and frequencyList<Collection>findAvailableSubscriptions(Context context)Find out which collections the currently logged in e-person can subscribe toList<Collection>findAvailableSubscriptions(Context context, EPerson eperson)Find out which collections an e-person can subscribe toSubscriptionfindById(Context context, int id)Finds a subscription by idList<Subscription>findSubscriptionsByEPerson(Context context, EPerson eperson, Integer limit, Integer offset)Find out which collections an e-person is subscribed toList<Subscription>findSubscriptionsByEPersonAndDso(Context context, EPerson eperson, DSpaceObject dSpaceObject, Integer limit, Integer offset)Find out which collections an e-person is subscribed to and related with dsobooleanisSubscribed(Context context, EPerson eperson, DSpaceObject dSpaceObject)Is that e-person subscribed to that collection?SubscriptionremoveSubscriptionParameter(Context context, Integer id, SubscriptionParameter subscriptionParam)Deletes a parameter from subscriptionSubscriptionsubscribe(Context context, EPerson eperson, DSpaceObject dSpaceObject, List<SubscriptionParameter> subscriptionParameters, String subscriptionType)Subscribe an EPerson to a dSpaceObject (Collection or Community).voidunsubscribe(Context context, EPerson eperson, DSpaceObject dSpaceObject)Unsubscribe an e-person to a collection.SubscriptionupdateSubscription(Context context, Integer id, String subscriptionType, List<SubscriptionParameter> subscriptionParameterList)Updates a subscription by id
-
-
-
Method Detail
-
findAll
List<Subscription> findAll(Context context, String resourceType, Integer limit, Integer offset) throws Exception
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 contextlimit- Number of subscriptions to returnoffset- Offset number- Returns:
- list of Subscription objects
- Throws:
SQLException- An exception that provides information on a database access error or other errors.Exception
-
subscribe
Subscription subscribe(Context context, EPerson eperson, DSpaceObject dSpaceObject, List<SubscriptionParameter> subscriptionParameters, String subscriptionType) throws SQLException, AuthorizeException
Subscribe an EPerson to a dSpaceObject (Collection or Community). An e-mail will be sent every day a new item appears in the Collection or Community.- Parameters:
context- DSpace context objecteperson- EPerson to subscribedSpaceObject- DSpaceObject to subscribesubscriptionParameters- list of @SubscriptionParametersubscriptionType- Currently supported only "content"- Returns:
- 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, DSpaceObject dSpaceObject) 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 unsubscribedSpaceObject- DSpaceObject 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.
-
findSubscriptionsByEPerson
List<Subscription> findSubscriptionsByEPerson(Context context, EPerson eperson, Integer limit, Integer offset) throws SQLException
Find out which collections an e-person is subscribed to- Parameters:
context- DSpace contexteperson- EPersonlimit- Number of subscriptions to returnoffset- Offset number- Returns:
- array of collections e-person is subscribed to
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findSubscriptionsByEPersonAndDso
List<Subscription> findSubscriptionsByEPersonAndDso(Context context, EPerson eperson, DSpaceObject dSpaceObject, Integer limit, Integer offset) throws SQLException
Find out which collections an e-person is subscribed to and related with dso- Parameters:
context- DSpace contexteperson- EPersondSpaceObject- DSpaceObjectlimit- Number of subscriptions to returnoffset- Offset number- Returns:
- array of collections e-person is subscribed to and related with dso
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findAvailableSubscriptions
List<Collection> findAvailableSubscriptions(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.
-
findAvailableSubscriptions
List<Collection> findAvailableSubscriptions(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, DSpaceObject dSpaceObject) throws SQLException
Is that e-person subscribed to that collection?- Parameters:
context- DSpace contexteperson- find out if this e-person is subscribeddSpaceObject- find out if subscribed to this dSpaceObject- Returns:
trueif they are subscribed- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
deleteByDspaceObject
void deleteByDspaceObject(Context context, DSpaceObject dSpaceObject) throws SQLException
Delete subscription by collection.- Parameters:
context- DSpace contextdSpaceObject- find out if subscribed to this dSpaceObject- 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.
-
findById
Subscription findById(Context context, int id) throws SQLException
Finds a subscription by id- Parameters:
context- DSpace contextid- the id of subscription to be searched- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
updateSubscription
Subscription updateSubscription(Context context, Integer id, String subscriptionType, List<SubscriptionParameter> subscriptionParameterList) throws SQLException
Updates a subscription by id- Parameters:
context- DSpace contextid- Integer idsubscriptionParameterList- ListsubscriptionParameterList subscriptionType- type- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
addSubscriptionParameter
Subscription addSubscriptionParameter(Context context, Integer id, SubscriptionParameter subscriptionParameter) throws SQLException
Adds a parameter to a subscription- Parameters:
context- DSpace contextid- Integer idsubscriptionParameter- SubscriptionParameter subscriptionParameter- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
removeSubscriptionParameter
Subscription removeSubscriptionParameter(Context context, Integer id, SubscriptionParameter subscriptionParam) throws SQLException
Deletes a parameter from subscription- Parameters:
context- DSpace contextid- Integer idsubscriptionParam- SubscriptionParameter subscriptionParameter- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
deleteSubscription
void deleteSubscription(Context context, Subscription subscription) throws SQLException
Deletes a subscription- Parameters:
context- DSpace contextsubscription- The subscription to delete- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findAllSubscriptionsBySubscriptionTypeAndFrequency
List<Subscription> findAllSubscriptionsBySubscriptionTypeAndFrequency(Context context, String subscriptionType, String frequencyValue) throws SQLException
Finds all subscriptions by subscriptionType and frequency- Parameters:
context- DSpace contextsubscriptionType- Could be "content" or "statistics". NOTE: in DSpace we have only "content"frequencyValue- Could be "D" stand for Day, "W" stand for Week, and "M" stand for Month- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
countAll
Long countAll(Context context) throws SQLException
Counts all subscriptions- Parameters:
context- DSpace context- Throws:
SQLException
-
countSubscriptionsByEPerson
Long countSubscriptionsByEPerson(Context context, EPerson ePerson) throws SQLException
Counts all subscriptions by ePerson- Parameters:
context- DSpace contextePerson- EPerson ePerson- Throws:
SQLException
-
countByEPersonAndDSO
Long countByEPersonAndDSO(Context context, EPerson ePerson, DSpaceObject dSpaceObject) throws SQLException
Counts all subscriptions by ePerson and DSO- Parameters:
context- DSpace contextePerson- EPerson ePersondSpaceObject- DSpaceObject dSpaceObject- Throws:
SQLException
-
-