Package org.dspace.app.ldn.service
Interface LDNMessageService
- All Known Implementing Classes:
LDNMessageServiceImpl
public interface LDNMessageService
Service interface class for the
LDNMessageEntity object.- Author:
- Mohamed Eskander (mohamed.eskander at 4science dot it)
-
Method Summary
Modifier and TypeMethodDescriptionintcheckQueueMessageTimeout(Context context) Find all messages in the queue with the Processing status but timed-out and modify their queue_status considering the queue_attemptsCreates a new LDNMessagecreate(Context context, Notification notification, String sourceIp) Creates a new LDNMessagevoiddelete(Context context, LDNMessageEntity ldnMessage) delete the provided ldn messageintextractAndProcessMessageFromQueue(Context context) Elaborates the oldest enqueued messagefind the ldn message by idfind all ldn messagesfindEndorsementOrReviewResubmissionIdByItem(Context context, Item item, NotifyServiceEntity service) find the UUID of a previous tentativeReject notification associated with a new resubmission (Endorsement or Review patterns only)findMessagesToBeReprocessed(Context context) find the ldn messages to be reprocessedfindNotifyService(Context context, Service service) find the related notify service entityfindOldestMessagesToProcess(Context context) Find the oldest queued LDNMessages that still can be elaboratedfindProcessingTimedoutMessages(Context context) Find all messages in the queue with the Processing status but timed-outfindRequestsByItem(Context context, Item item) find the ldn messages of Requests by item uuidbooleanisTargetCurrent(Notification notification) check if the notification is targeting the current systembooleanisValidIp(NotifyServiceEntity origin, String sourceIp) check if IP number is included in the configured ip-range on the Notify Servicevoidupdate(Context context, LDNMessageEntity ldnMessage) Update the provided LDNMessage
-
Method Details
-
find
find the ldn message by id- Parameters:
context- the contextid- the uri- Returns:
- the ldn message by id
- Throws:
SQLException- If something goes wrong in the database
-
findAll
find all ldn messages- Parameters:
context- the context- Returns:
- all ldn messages by id
- Throws:
SQLException- If something goes wrong in the database
-
create
Creates a new LDNMessage- Parameters:
context- The DSpace contextid- the uri- Returns:
- the created LDN Message
- Throws:
SQLException- If something goes wrong in the database
-
create
LDNMessageEntity create(Context context, Notification notification, String sourceIp) throws SQLException Creates a new LDNMessage- Parameters:
context- The DSpace contextnotification- the requested notificationsourceIp- the source ip- Returns:
- the created LDN Message
- Throws:
SQLException- If something goes wrong in the database
-
update
Update the provided LDNMessage- Parameters:
context- The DSpace contextldnMessage- the LDNMessage- Throws:
SQLException- If something goes wrong in the database
-
findOldestMessagesToProcess
Find the oldest queued LDNMessages that still can be elaborated- Parameters:
context- The DSpace context- Returns:
- list of LDN messages
- Throws:
SQLException- If something goes wrong in the database
-
findProcessingTimedoutMessages
Find all messages in the queue with the Processing status but timed-out- Parameters:
context- The DSpace context- Returns:
- all the LDN Messages to be fixed on their queue_ attributes
- Throws:
SQLException- If something goes wrong in the database
-
checkQueueMessageTimeout
Find all messages in the queue with the Processing status but timed-out and modify their queue_status considering the queue_attempts- Parameters:
context- The DSpace context- Returns:
- number of messages fixed
- Throws:
SQLException
-
extractAndProcessMessageFromQueue
Elaborates the oldest enqueued message- Parameters:
context- The DSpace context- Returns:
- number of messages fixed
- Throws:
SQLException
-
findNotifyService
find the related notify service entity- Parameters:
context- the contextservice- the service- Returns:
- the NotifyServiceEntity
- Throws:
SQLException- if something goes wrong
-
findRequestsByItem
find the ldn messages of Requests by item uuid- Parameters:
context- the contextitem- the item- Returns:
- the item requests object
- Throws:
SQLException- If something goes wrong in the database
-
findEndorsementOrReviewResubmissionIdByItem
String findEndorsementOrReviewResubmissionIdByItem(Context context, Item item, NotifyServiceEntity service) throws SQLException find the UUID of a previous tentativeReject notification associated with a new resubmission (Endorsement or Review patterns only)- Parameters:
context- the contextitem- the previousVersion item associated with a potential resubmission- Returns:
- the UUID of a previous tentativeReject notification associated with a potential resubmission if found
- Throws:
SQLException
-
delete
delete the provided ldn message- Parameters:
context- the contextldnMessage- the ldn message- Throws:
SQLException- if something goes wrong
-
findMessagesToBeReprocessed
find the ldn messages to be reprocessed- Parameters:
context- the context- Throws:
SQLException- if something goes wrong
-
isValidIp
check if IP number is included in the configured ip-range on the Notify Service- Parameters:
origin- the Notify Service entitysourceIp- the ip to evaluate
-
isTargetCurrent
check if the notification is targeting the current system- Parameters:
notification- the LDN Message entity
-