Class AS2SenderModule

    • Field Detail

      • logger

        private org.apache.commons.logging.Log logger
    • Constructor Detail

      • AS2SenderModule

        public AS2SenderModule()
    • Method Detail

      • canHandle

        public boolean canHandle​(java.lang.String action,
                                 Message msg,
                                 java.util.Map<java.lang.Object,​java.lang.Object> options)
        Specified by:
        canHandle in interface ProcessorModule
      • sendMessage

        private void sendMessage​(java.lang.String url,
                                 Message msg,
                                 javax.mail.internet.MimeBodyPart securedData,
                                 java.lang.String retries)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • secure

        protected javax.mail.internet.MimeBodyPart secure​(Message msg)
                                                   throws java.lang.Exception
        Returns a MimeBodyPart or MimeMultipart object
        Parameters:
        msg - The message object carried around containing necessary information
        Returns:
        The secured mimebodypart
        Throws:
        java.lang.Exception - some unforseen issue has occurred
      • addCustomOuterMimeHeaders

        protected void addCustomOuterMimeHeaders​(Message msg,
                                                 javax.mail.internet.MimeBodyPart dataBP)
                                          throws javax.mail.MessagingException
        Throws:
        javax.mail.MessagingException
      • getHttpHeaders

        protected javax.mail.internet.InternetHeaders getHttpHeaders​(Message msg,
                                                                     javax.mail.internet.MimeBodyPart securedData)
                                                              throws javax.mail.MessagingException
        Throws:
        javax.mail.MessagingException
      • storePendingInfo

        protected void storePendingInfo​(AS2Message msg,
                                        boolean isResend)
                                 throws java.lang.Exception
        Stores metadata into pending information file and storing message object from first send attempt. The message object is written to a separate file to avoid repeated rewrites of possibly very large objects since it contains the original file data
        Parameters:
        msg - AS2Message structure
        isResend - Boolean to determine if this is a resend of an already sent message or not
        Throws:
        java.lang.Exception - some unforseen issue has occurred
      • calcAndStoreMic

        protected void calcAndStoreMic​(Message msg,
                                       javax.mail.internet.MimeBodyPart mbp,
                                       boolean includeHeaders)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • detectFailedSentMessages

        protected void detectFailedSentMessages()
      • schedule

        public void schedule​(java.util.concurrent.ScheduledExecutorService executor)
        Specified by:
        schedule in interface HasSchedule