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
Modifier and TypeClassDescriptionstatic class
Provide an Filename Format instance for use in Velocity templates. -
Field Summary
Modifier and TypeFieldDescriptionprotected DeploymentPropertyDao
protected ErrorLogService
protected EventLogService
static final String
String property to store email escalation time in hoursstatic final String
String property to store secure email reminder time in hours -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompleteRESTDelivery
(DeliveryDetails deliveryDetails, Submission submission, boolean deleteData, String processingStatus) Complete REST Service submission delivery and return the completed submission.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.errorRESTDelivery
(DeliveryDetails deliveryDetails, Submission submission, String errorMessage, HttpServletRequest request) Set a REST submission delivery error and return the updated submission.Return The maximum age in hours before late secure submission delivery escalation emails.Return The email message for late secure submission delivery escalation emails.Return the email subject for late secure submission delivery escalation emails.Return the maximum number of delivery attempts for email delivery (including email secure).Return the interval in minutes between retries for failed email delivery (including email secure).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.Return The email message for secure submission delivery emails.Return The email subject for secure submission delivery emails.Return The maximum age in hours before secure submission delivery reminder emails are sent out.Return The email message for secure submission delivery reminder emails.Return The email subject for secure submission delivery reminder emails.Return The email message for standard submission delivery emails.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
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 Details
-
PARAM_EMAIL_ESCALATION_AGE
String property to store email escalation time in hours- See Also:
-
PARAM_SECURE_EMAIL_REMINDER_AGE
String property to store secure email reminder time in hours- See Also:
-
deploymentPropertyDao
-
errorLogService
-
eventLogService
-
-
Constructor Details
-
SubmissionDeliveryControllerService
public SubmissionDeliveryControllerService()
-
-
Method Details
-
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
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
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
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
Return the email subject for late secure submission delivery escalation emails.- Returns:
- the email subject for late secure submission delivery escalation emails.
-
setDeliveryEmailEscalationSubject
Set the email subject for late secure submission delivery escalation emails.- Parameters:
newSubject
- the email subject for late secure submission delivery escalation emails.
-
getDeliveryEmailEscalationMessage
Return The email message for late secure submission delivery escalation emails.- Returns:
- the email message for late secure submission delivery escalation emails.
-
setDeliveryEmailEscalationMessage
Set The email message for late secure submission delivery escalation emails.- Parameters:
newMessage
- the email message for late secure submission delivery escalation emails.
-
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:
-
setDeliveryEmailEscalationAgeHours
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
Return The email message for standard submission delivery emails.- Returns:
- the email message for standard submission delivery emails.
-
setStandardEmailDeliveryMessage
Set The email message for standard submission delivery emails.- Parameters:
newMessage
- the email message for standard submission delivery emails.
-
getStandardEmailDeliverySubject
Return The email subject for standard submission delivery emails.- Returns:
- the email subject for standard submission delivery emails.
-
setStandardEmailDeliverySubject
Set The email subject for standard submission delivery emails.- Parameters:
newSubject
- the email subject for standard submission delivery emails.
-
getSecureEmailDeliverySubject
Return The email subject for secure submission delivery emails.- Returns:
- the email subject for secure submission delivery emails.
-
setSecureEmailDeliverySubject
Set The email subject for secure submission delivery emails.- Parameters:
newSubject
- the email subject for secure submission delivery emails.
-
getSecureEmailDeliveryMessage
Return The email message for secure submission delivery emails.- Returns:
- the email message for secure submission delivery emails.
-
setSecureEmailDeliveryMessage
Set The email message for secure submission delivery emails.- Parameters:
newMessage
- the email message for secure submission delivery emails.
-
getSecureEmailReminderSubject
Return The email subject for secure submission delivery reminder emails.- Returns:
- the email subject for secure submission delivery reminder emails.
-
setSecureEmailReminderSubject
Set The email subject for secure submission delivery reminder emails.- Parameters:
newSubject
- the email subject for secure submission delivery reminder emails.
-
getSecureEmailReminderMessage
Return The email message for secure submission delivery reminder emails.- Returns:
- the email message for secure submission delivery reminder emails.
-
setSecureEmailReminderMessage
Set The email message for secure submission delivery reminder emails.- Parameters:
newMessage
- the email message for secure submission delivery reminder emails.
-
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:
-
setSecureEmailReminderAgeHours
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
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:
-
getNextRESTSubmission
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:
-
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:
-
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:
-
setAttachmentDeliveryCompleted
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:
-
setSubmissionDeliveryCompleted
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:
-
setEmailSubmissionDeliveryCompleted
Set the submission delivery status as completed.- Specified by:
setEmailSubmissionDeliveryCompleted
in interfaceISubmissionDeliveryController
- Parameters:
submission
- the submission to update as delivery completed- See Also:
-
setSubmissionDeliveryCompletedByAdmin
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:
-
sendEmailReminder
Send an submission delivery reminder email.- Specified by:
sendEmailReminder
in interfaceISubmissionDeliveryController
- Parameters:
submission
- the submission to send the reminder email to- See Also:
-
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:
-
deliverViaEmail
Deliver the given submission via email using the delivery details provided. -
deliverViaEmailSecure
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
-