Package com.avoka.fc.core.service.impl
Class SubmissionDeliveryControllerService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.impl.SubmissionDeliveryControllerService
-
- All Implemented Interfaces:
ISubmissionDeliveryController
public class SubmissionDeliveryControllerService extends CayenneService implements ISubmissionDeliveryController
Provides an implementation of SubmissionDeliveryController.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SubmissionDeliveryControllerService.FilenameFormat
Provide an Filename Format instance for use in Velocity templates.
-
Field Summary
Fields Modifier and Type Field Description protected DeploymentPropertyDao
deploymentPropertyDao
protected ErrorLogService
errorLogService
protected EventLogService
eventLogService
static String
PARAM_EMAIL_ESCALATION_AGE
String property to store email escalation time in hoursstatic String
PARAM_SECURE_EMAIL_REMINDER_AGE
String property to store secure email reminder time in hours
-
Constructor Summary
Constructors Constructor Description SubmissionDeliveryControllerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Submission
completeRESTDelivery(DeliveryDetails deliveryDetails, Submission submission, boolean deleteData, String processingStatus)
Complete REST Service submission delivery and return the completed submission.String
deliverSubmission(Submission submission)
Deliver the given submission and return a delivery status message.protected String
deliverViaDeliveryProcess(Submission submission, DeliveryDetails deliveryDetails, IDeliveryProcessService deliveryProcess, String deliveryServiceName)
Deliver the given submission via Delivery Process using the delivery details provided.protected String
deliverViaEmail(Submission submission, DeliveryDetails deliveryDetails)
Deliver the given submission via email using the delivery details provided.protected String
deliverViaEmailSecure(Submission submission, DeliveryDetails deliveryDetails)
Deliver the given submission via email using the delivery details provided.Submission
errorRESTDelivery(DeliveryDetails deliveryDetails, Submission submission, String errorMessage, HttpServletRequest request)
Set a REST submission delivery error and return the updated submission.String
getDeliveryEmailEscalationAgeHours()
Return The maximum age in hours before late secure submission delivery escalation emails.String
getDeliveryEmailEscalationMessage()
Return The email message for late secure submission delivery escalation emails.String
getDeliveryEmailEscalationSubject()
Return the email subject for late secure submission delivery escalation emails.Integer
getEmailDeliveryMaxRetryAttempts()
Return the maximum number of delivery attempts for email delivery (including email secure).Integer
getEmailDeliveryRetryInterval()
Return the interval in minutes between retries for failed email delivery (including email secure).Submission
getNextRESTSubmission(DeliveryDetails deliveryDetails)
Return the next submission ready for delivery for the given REST Service delivery details, and set the Submission delivery status to 'In Progress' or null otherwise.String
getSecureEmailDeliveryMessage()
Return The email message for secure submission delivery emails.String
getSecureEmailDeliverySubject()
Return The email subject for secure submission delivery emails.String
getSecureEmailReminderAgeHours()
Return The maximum age in hours before secure submission delivery reminder emails are sent out.String
getSecureEmailReminderMessage()
Return The email message for secure submission delivery reminder emails.String
getSecureEmailReminderSubject()
Return The email subject for secure submission delivery reminder emails.String
getStandardEmailDeliveryMessage()
Return The email message for standard submission delivery emails.String
getStandardEmailDeliverySubject()
Return The email subject for standard submission delivery emails.void
sendEmailEscalation(Client client, List<UserAccount> recipients, long numberOfEscalations)
Send a submission delivery escalation email.void
sendEmailReminder(Submission submission)
Send an submission delivery reminder email.void
setAttachmentDeliveryCompleted(Attachment attachment, String dataHash)
Set the attachment delivery status as completed.void
setDeliveryEmailEscalationAgeHours(String newAge)
Set The maximum age in hours before late secure submission delivery escalation emails.void
setDeliveryEmailEscalationMessage(String newMessage)
Set The email message for late secure submission delivery escalation emails.void
setDeliveryEmailEscalationSubject(String newSubject)
Set the email subject for late secure submission delivery escalation emails.void
setEmailDeliveryMaxRetryAttempts(Integer emailDeliveryMaxRetryAttempts)
Set the maximum number of delivery attempts for email delivery (including email secure).void
setEmailDeliveryRetryInterval(Integer emailDeliveryRetryInterval)
Set the interval in minutes between retries for failed email delivery (including email secure).void
setEmailSubmissionDeliveryCompleted(Submission submission)
Set the submission delivery status as completed.void
setSecureEmailDeliveryMessage(String newMessage)
Set The email message for secure submission delivery emails.void
setSecureEmailDeliverySubject(String newSubject)
Set The email subject for secure submission delivery emails.void
setSecureEmailReminderAgeHours(String newAge)
Set The maximum age in hours before secure submission delivery reminder emails are sent out.void
setSecureEmailReminderMessage(String newMessage)
Set The email message for secure submission delivery reminder emails.void
setSecureEmailReminderSubject(String newSubject)
Set The email subject for secure submission delivery reminder emails.void
setStandardEmailDeliveryMessage(String newMessage)
Set The email message for standard submission delivery emails.void
setStandardEmailDeliverySubject(String newSubject)
Set The email subject for standard submission delivery emails.void
setSubmissionDeliveryCompleted(Submission submission, String dataHash)
Set the submission delivery status as completed and delete the submission data if configured.void
setSubmissionDeliveryCompletedByAdmin(Submission submission, String userName)
Set the submission delivery status as completed.-
Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
-
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
-
-
-
Field Detail
-
PARAM_EMAIL_ESCALATION_AGE
public static final String PARAM_EMAIL_ESCALATION_AGE
String property to store email escalation time in hours- See Also:
- Constant Field Values
-
PARAM_SECURE_EMAIL_REMINDER_AGE
public static final String PARAM_SECURE_EMAIL_REMINDER_AGE
String property to store secure email reminder time in hours- See Also:
- Constant Field Values
-
deploymentPropertyDao
protected DeploymentPropertyDao deploymentPropertyDao
-
errorLogService
protected ErrorLogService errorLogService
-
eventLogService
protected EventLogService eventLogService
-
-
Method Detail
-
getEmailDeliveryMaxRetryAttempts
public Integer getEmailDeliveryMaxRetryAttempts()
Return the maximum number of delivery attempts for email delivery (including email secure).- Returns:
- the maximum number of delivery attempts (1 = only one delivery attempt is made, no retries happen if this fails)
- Since:
- 4.0.1
-
setEmailDeliveryMaxRetryAttempts
public void setEmailDeliveryMaxRetryAttempts(Integer emailDeliveryMaxRetryAttempts)
Set the maximum number of delivery attempts for email delivery (including email secure).- Parameters:
emailDeliveryMaxRetryAttempts
- the maximum number of delivery attempts (1 = only one delivery attempt is made, no retries happen if this fails)- Since:
- 4.0.1
-
getEmailDeliveryRetryInterval
public Integer getEmailDeliveryRetryInterval()
Return the interval in minutes between retries for failed email delivery (including email secure).- Returns:
- the interval in minutes between email delivery attempts
- Since:
- 4.0.1
-
setEmailDeliveryRetryInterval
public void setEmailDeliveryRetryInterval(Integer emailDeliveryRetryInterval)
Set the interval in minutes between retries for failed email delivery (including email secure).- Parameters:
emailDeliveryRetryInterval
- the interval in minutes between email delivery attempts- Since:
- 4.0.1
-
getDeliveryEmailEscalationSubject
public String getDeliveryEmailEscalationSubject()
Return the email subject for late secure submission delivery escalation emails.- Returns:
- the email subject for late secure submission delivery escalation emails.
-
setDeliveryEmailEscalationSubject
public void setDeliveryEmailEscalationSubject(String newSubject)
Set the email subject for late secure submission delivery escalation emails.- Parameters:
newSubject
- the email subject for late secure submission delivery escalation emails.
-
getDeliveryEmailEscalationMessage
public String getDeliveryEmailEscalationMessage()
Return The email message for late secure submission delivery escalation emails.- Returns:
- the email message for late secure submission delivery escalation emails.
-
setDeliveryEmailEscalationMessage
public void setDeliveryEmailEscalationMessage(String newMessage)
Set The email message for late secure submission delivery escalation emails.- Parameters:
newMessage
- the email message for late secure submission delivery escalation emails.
-
getDeliveryEmailEscalationAgeHours
public String getDeliveryEmailEscalationAgeHours()
Return The maximum age in hours before late secure submission delivery escalation emails.- Specified by:
getDeliveryEmailEscalationAgeHours
in interfaceISubmissionDeliveryController
- Returns:
- the maximum age in hours before late secure submission delivery escalation emails.
- See Also:
ISubmissionDeliveryController.getDeliveryEmailEscalationAgeHours()
-
setDeliveryEmailEscalationAgeHours
public void setDeliveryEmailEscalationAgeHours(String newAge)
Set The maximum age in hours before late secure submission delivery escalation emails.- Parameters:
newAge
- the maximum age in hours before late secure submission delivery escalation emails.
-
getStandardEmailDeliveryMessage
public String getStandardEmailDeliveryMessage()
Return The email message for standard submission delivery emails.- Returns:
- the email message for standard submission delivery emails.
-
setStandardEmailDeliveryMessage
public void setStandardEmailDeliveryMessage(String newMessage)
Set The email message for standard submission delivery emails.- Parameters:
newMessage
- the email message for standard submission delivery emails.
-
getStandardEmailDeliverySubject
public String getStandardEmailDeliverySubject()
Return The email subject for standard submission delivery emails.- Returns:
- the email subject for standard submission delivery emails.
-
setStandardEmailDeliverySubject
public void setStandardEmailDeliverySubject(String newSubject)
Set The email subject for standard submission delivery emails.- Parameters:
newSubject
- the email subject for standard submission delivery emails.
-
getSecureEmailDeliverySubject
public String getSecureEmailDeliverySubject()
Return The email subject for secure submission delivery emails.- Returns:
- the email subject for secure submission delivery emails.
-
setSecureEmailDeliverySubject
public void setSecureEmailDeliverySubject(String newSubject)
Set The email subject for secure submission delivery emails.- Parameters:
newSubject
- the email subject for secure submission delivery emails.
-
getSecureEmailDeliveryMessage
public String getSecureEmailDeliveryMessage()
Return The email message for secure submission delivery emails.- Returns:
- the email message for secure submission delivery emails.
-
setSecureEmailDeliveryMessage
public void setSecureEmailDeliveryMessage(String newMessage)
Set The email message for secure submission delivery emails.- Parameters:
newMessage
- the email message for secure submission delivery emails.
-
getSecureEmailReminderSubject
public String getSecureEmailReminderSubject()
Return The email subject for secure submission delivery reminder emails.- Returns:
- the email subject for secure submission delivery reminder emails.
-
setSecureEmailReminderSubject
public void setSecureEmailReminderSubject(String newSubject)
Set The email subject for secure submission delivery reminder emails.- Parameters:
newSubject
- the email subject for secure submission delivery reminder emails.
-
getSecureEmailReminderMessage
public String getSecureEmailReminderMessage()
Return The email message for secure submission delivery reminder emails.- Returns:
- the email message for secure submission delivery reminder emails.
-
setSecureEmailReminderMessage
public void setSecureEmailReminderMessage(String newMessage)
Set The email message for secure submission delivery reminder emails.- Parameters:
newMessage
- the email message for secure submission delivery reminder emails.
-
getSecureEmailReminderAgeHours
public String getSecureEmailReminderAgeHours()
Return The maximum age in hours before secure submission delivery reminder emails are sent out.- Specified by:
getSecureEmailReminderAgeHours
in interfaceISubmissionDeliveryController
- Returns:
- the maximum age in hours before secure submission delivery reminder emails are sent out.
- See Also:
ISubmissionDeliveryController.getSecureEmailReminderAgeHours()
-
setSecureEmailReminderAgeHours
public void setSecureEmailReminderAgeHours(String newAge)
Set The maximum age in hours before secure submission delivery reminder emails are sent out.- Parameters:
newAge
- the maximum age in hours before secure submission delivery reminder emails are sent out.
-
deliverSubmission
public String deliverSubmission(Submission submission)
Deliver the given submission and return a delivery status message. Note: The submission is either fully completed by the user, or is an abandoned submission to be handled by a specialised delivery process.- Specified by:
deliverSubmission
in interfaceISubmissionDeliveryController
- Parameters:
submission
- the submission to deliver- Returns:
- a delivery status message
- See Also:
ISubmissionDeliveryController.deliverSubmission(Submission)
-
getNextRESTSubmission
public Submission getNextRESTSubmission(DeliveryDetails deliveryDetails)
Return the next submission ready for delivery for the given REST Service delivery details, and set the Submission delivery status to 'In Progress' or null otherwise.- Specified by:
getNextRESTSubmission
in interfaceISubmissionDeliveryController
- Parameters:
deliveryDetails
- the 'REST Service' delivery details (required)- Returns:
- the next submission if available, or null otherwise.
- Since:
- 4.1.8
- See Also:
ISubmissionDeliveryController.getNextRESTSubmission(DeliveryDetails)
-
completeRESTDelivery
public Submission completeRESTDelivery(DeliveryDetails deliveryDetails, Submission submission, boolean deleteData, String processingStatus)
Complete REST Service submission delivery and return the completed submission.- Specified by:
completeRESTDelivery
in interfaceISubmissionDeliveryController
- Parameters:
deliveryDetails
- the REST Service delivery details (required)submission
- the submission to complete, must be associated with 'REST Service' delivery details (required)deleteData
- specify whether to delete transaction data immediatelyprocessingStatus
- the submission processing status message to set (optional)- Returns:
- the completed submission
- Since:
- 4.1.8
- See Also:
ISubmissionDeliveryController.completeRESTDelivery(DeliveryDetails, Submission, boolean, String)
-
errorRESTDelivery
public Submission errorRESTDelivery(DeliveryDetails deliveryDetails, Submission submission, String errorMessage, HttpServletRequest request)
Set a REST submission delivery error and return the updated submission.- Specified by:
errorRESTDelivery
in interfaceISubmissionDeliveryController
- Parameters:
deliveryDetails
- the REST Service delivery details (required)submission
- the submission to update with an Error delivery status (required)errorMessage
- the submission delivery error message to set (required)request
- the REST operation request (required)- Returns:
- the updated submission
- Since:
- 4.3.0
- See Also:
ISubmissionDeliveryController.errorRESTDelivery(DeliveryDetails,Submission, String, HttpServletRequest)
-
setAttachmentDeliveryCompleted
public void setAttachmentDeliveryCompleted(Attachment attachment, String dataHash) throws Exception
Set the attachment delivery status as completed.- Specified by:
setAttachmentDeliveryCompleted
in interfaceISubmissionDeliveryController
- Parameters:
attachment
- the attachment to update as delivery completed (required)dataHash
- the attachment SHA-256 data confirmation hash (required)- Throws:
Exception
- if an error occurs- See Also:
ISubmissionDeliveryController.setAttachmentDeliveryCompleted(Attachment, String)
-
setSubmissionDeliveryCompleted
public void setSubmissionDeliveryCompleted(Submission submission, String dataHash) throws Exception
Set the submission delivery status as completed and delete the submission data if configured.- Specified by:
setSubmissionDeliveryCompleted
in interfaceISubmissionDeliveryController
- Parameters:
submission
- the submission to update as delivery completed (required)dataHash
- the attachment SHA-256 data confirmation hash (required)- Throws:
Exception
- if an error occurs- See Also:
ISubmissionDeliveryController.setSubmissionDeliveryCompleted(Submission, String)
-
setEmailSubmissionDeliveryCompleted
public void setEmailSubmissionDeliveryCompleted(Submission submission)
Set the submission delivery status as completed.- Specified by:
setEmailSubmissionDeliveryCompleted
in interfaceISubmissionDeliveryController
- Parameters:
submission
- the submission to update as delivery completed- See Also:
ISubmissionDeliveryController.setEmailSubmissionDeliveryCompleted(Submission)
-
setSubmissionDeliveryCompletedByAdmin
public void setSubmissionDeliveryCompletedByAdmin(Submission submission, String userName)
Set the submission delivery status as completed.- Specified by:
setSubmissionDeliveryCompletedByAdmin
in interfaceISubmissionDeliveryController
- Parameters:
submission
- the submission to update as delivery completeduserName
- the login name for the administrator who set delivery to be completed- See Also:
ISubmissionDeliveryController.setSubmissionDeliveryCompletedByAdmin(Submission, String)
-
sendEmailReminder
public void sendEmailReminder(Submission submission)
Send an submission delivery reminder email.- Specified by:
sendEmailReminder
in interfaceISubmissionDeliveryController
- Parameters:
submission
- the submission to send the reminder email to- See Also:
ISubmissionDeliveryController.sendEmailReminder(Submission)
-
sendEmailEscalation
public void sendEmailEscalation(Client client, List<UserAccount> recipients, long numberOfEscalations)
Send a submission delivery escalation email.- Specified by:
sendEmailEscalation
in interfaceISubmissionDeliveryController
- Parameters:
client
- the client for which an email should be sentrecipients
- the users to send the escalation email tonumberOfEscalations
- the number of undelivered submissions Note that this method contains database transactions.- See Also:
ISubmissionDeliveryController.sendEmailEscalation(Client, List, long)
-
deliverViaEmail
protected String deliverViaEmail(Submission submission, DeliveryDetails deliveryDetails)
Deliver the given submission via email using the delivery details provided.
-
deliverViaEmailSecure
protected String deliverViaEmailSecure(Submission submission, DeliveryDetails deliveryDetails)
Deliver the given submission via email using the delivery details provided.
-
deliverViaDeliveryProcess
protected String deliverViaDeliveryProcess(Submission submission, DeliveryDetails deliveryDetails, IDeliveryProcessService deliveryProcess, String deliveryServiceName) throws Exception
Deliver the given submission via Delivery Process using the delivery details provided. Note that for abandoned submissions, the delivery details will be null.- Throws:
Exception
-
-