Class CommunicationEventServices


  • public class CommunicationEventServices
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
      static java.lang.String resource  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> createCommEventFromEmail​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> createCommEventFromFtpTransfer​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> logIncomingMessage​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.lang.String markCommunicationAsRead​(HttpServletRequest request, HttpServletResponse response)  
      static java.util.Map<java.lang.String,​java.lang.Object> processBouncedMessage​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> sendCommEventAsEmail​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> sendCommEventAsFtp​(DispatchContext ctx, java.util.Map<java.lang.String,​?> context)
      Service to send all content associated to a FILE_TRANSFER_COMM CommunicationEvent, with contactMechIdTo as a FtpAdress contactMech
      static java.util.Map<java.lang.String,​java.lang.Object> sendEmailToContactList​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> setCommEventComplete​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> storeIncomingEmail​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      This service is the main one for processing incoming emails.
      static java.util.Map<java.lang.String,​java.lang.Object> updateCommEventAfterEmail​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
    • Constructor Detail

      • CommunicationEventServices

        public CommunicationEventServices()
    • Method Detail

      • sendCommEventAsEmail

        public static java.util.Map<java.lang.String,​java.lang.Object> sendCommEventAsEmail​(DispatchContext ctx,
                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • sendCommEventAsFtp

        public static java.util.Map<java.lang.String,​java.lang.Object> sendCommEventAsFtp​(DispatchContext ctx,
                                                                                                java.util.Map<java.lang.String,​?> context)
        Service to send all content associated to a FILE_TRANSFER_COMM CommunicationEvent, with contactMechIdTo as a FtpAdress contactMech
        Parameters:
        ctx -
        context -
        Returns:
      • sendEmailToContactList

        public static java.util.Map<java.lang.String,​java.lang.Object> sendEmailToContactList​(DispatchContext ctx,
                                                                                                    java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • setCommEventComplete

        public static java.util.Map<java.lang.String,​java.lang.Object> setCommEventComplete​(DispatchContext dctx,
                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createCommEventFromFtpTransfer

        public static java.util.Map<java.lang.String,​java.lang.Object> createCommEventFromFtpTransfer​(DispatchContext dctx,
                                                                                                            java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createCommEventFromEmail

        public static java.util.Map<java.lang.String,​java.lang.Object> createCommEventFromEmail​(DispatchContext dctx,
                                                                                                      java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • updateCommEventAfterEmail

        public static java.util.Map<java.lang.String,​java.lang.Object> updateCommEventAfterEmail​(DispatchContext dctx,
                                                                                                       java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • storeIncomingEmail

        public static java.util.Map<java.lang.String,​java.lang.Object> storeIncomingEmail​(DispatchContext dctx,
                                                                                                java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        This service is the main one for processing incoming emails. Its only argument is a wrapper for the JavaMail MimeMessage object. From this object, all the fields, headers and content of the message can be accessed. The first thing this service does is try to discover the partyId of the message sender by doing a reverse find on the email address. It uses the findPartyFromEmailAddress service to do this. It then creates a CommunicationEvent entity by calling the createCommunicationEvent service using the appropriate fields from the email and the discovered partyId, if it exists, as the partyIdFrom. Note that it sets the communicationEventTypeId field to AUTO_EMAIL_COMM. This is useful for tracking email generated communications. The service tries to find appropriate content for inclusion in the CommunicationEvent.content field. If the contentType of the content starts with "text", the getContent() call returns a string and it is used. If the contentType starts with "multipart", then the "parts" of the content are iterated thru and the first one of mime type, "text/..." is used. If the contentType has a value of "multipart" then the parts of the content (except the one used in the main CommunicationEvent.content field) are cycled thru and attached to the CommunicationEvent entity using the createCommContentDataResource service. This happens in the EmailWorker.addAttachmentsToCommEvent method. However multiparts can contain multiparts. A recursive function has been added. -Al Byers - Hans Bakker
        Parameters:
        dctx - the dispatch context
        context - the context
        Returns:
        returns the result of the service execution
      • processBouncedMessage

        public static java.util.Map<java.lang.String,​java.lang.Object> processBouncedMessage​(DispatchContext dctx,
                                                                                                   java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • logIncomingMessage

        public static java.util.Map<java.lang.String,​java.lang.Object> logIncomingMessage​(DispatchContext dctx,
                                                                                                java.util.Map<java.lang.String,​? extends java.lang.Object> context)