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.
  • Field Details

    • PARAM_EMAIL_ESCALATION_AGE

      public static final String PARAM_EMAIL_ESCALATION_AGE
      String property to store email escalation time in hours
      See Also:
    • 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:
    • deploymentPropertyDao

      protected DeploymentPropertyDao deploymentPropertyDao
    • errorLogService

      protected ErrorLogService errorLogService
    • eventLogService

      protected EventLogService eventLogService
  • Constructor Details

    • SubmissionDeliveryControllerService

      public SubmissionDeliveryControllerService()
  • Method Details

    • 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 interface ISubmissionDeliveryController
      Returns:
      the maximum age in hours before late secure submission delivery escalation emails.
      See Also:
    • 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 interface ISubmissionDeliveryController
      Returns:
      the maximum age in hours before secure submission delivery reminder emails are sent out.
      See Also:
    • 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 interface ISubmissionDeliveryController
      Parameters:
      submission - the submission to deliver
      Returns:
      a delivery status message
      See Also:
    • 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 interface ISubmissionDeliveryController
      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 interface ISubmissionDeliveryController
      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 immediately
      processingStatus - 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 interface ISubmissionDeliveryController
      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

      public void setAttachmentDeliveryCompleted(Attachment attachment, String dataHash) throws Exception
      Set the attachment delivery status as completed.
      Specified by:
      setAttachmentDeliveryCompleted in interface ISubmissionDeliveryController
      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

      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 interface ISubmissionDeliveryController
      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

      public void setEmailSubmissionDeliveryCompleted(Submission submission)
      Set the submission delivery status as completed.
      Specified by:
      setEmailSubmissionDeliveryCompleted in interface ISubmissionDeliveryController
      Parameters:
      submission - the submission to update as delivery completed
      See Also:
    • setSubmissionDeliveryCompletedByAdmin

      public void setSubmissionDeliveryCompletedByAdmin(Submission submission, String userName)
      Set the submission delivery status as completed.
      Specified by:
      setSubmissionDeliveryCompletedByAdmin in interface ISubmissionDeliveryController
      Parameters:
      submission - the submission to update as delivery completed
      userName - the login name for the administrator who set delivery to be completed
      See Also:
    • sendEmailReminder

      public void sendEmailReminder(Submission submission)
      Send an submission delivery reminder email.
      Specified by:
      sendEmailReminder in interface ISubmissionDeliveryController
      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 interface ISubmissionDeliveryController
      Parameters:
      client - the client for which an email should be sent
      recipients - the users to send the escalation email to
      numberOfEscalations - the number of undelivered submissions Note that this method contains database transactions.
      See Also:
    • 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