psdi.common.emailstner

Class LSNRUtil

  • java.lang.Object
    • psdi.common.emailstner.LSNRUtil


  • public class LSNRUtil
    extends java.lang.Object
    Class for processing email message and error messages
    • Constructor Summary

      Constructors 
      Constructor and Description
      LSNRUtil() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static MboRemote getCommTemplate(java.lang.String templateId, UserInfo ui)
      Get the comm template record
      static MboRemote getInboundCommRecord(MboRemote oldInbComm)
      Returns a new staging mbo with all the information from old record
      static MXLogger getLogger()
      Returns the logger to be used to log messages.
      static MboSetRemote getMboSet(java.lang.String name, UserInfo ui)
      Returns a business object set based on the name of the business object.
      static void handleErrorException(java.lang.Exception e, java.lang.String emailAddress, MboRemote inboundComm)
      Handle error case with changing status,error column and sending e-mail
      static void processMessage(MboRemote inboundComm)
      Process the message retrieved from mailserver in asynchronous way(non-JMS)
      static void processMessage(javax.jms.ObjectMessage objm)
      Process the message retrieved from mailserver
      static void processWorkFlow(MboRemote inboundComm, java.lang.String processName)
      Process workflow for the staging record
      static void sendEmail(MboRemote ownMbo, java.lang.String sendTo, java.lang.String templateName, java.lang.String senderFrom, java.lang.String subject, java.util.Date receivedDate, java.lang.Throwable t)
      Sends e-mail to sender/admin
      static void sendEmail(MboRemote ownMbo, java.lang.String sendTo, java.lang.String templateName, java.lang.Throwable t)
      Sends error email to more than one recipient
      static void sendEmail(java.lang.String messageStr, MboRemote ownMbo, java.lang.String sendTo, java.lang.String templateName)
      Sends error email to more than one recipient
      static void setLogger(MXLogger log)
      Set the logger to be used to log messages.
      static MboRemote updateInboundComm(java.lang.String[] attributeName, java.lang.String[] value, MboRemote oldInbComm)
      Update staging record with new value
      • Methods inherited from class java.lang.Object

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

      • LSNRUtil

        public LSNRUtil()
    • Method Detail

      • setLogger

        public static void setLogger(MXLogger log)
        Set the logger to be used to log messages.
        Parameters:
        logger - the logger to be used to log messages.
      • getLogger

        public static MXLogger getLogger()
        Returns the logger to be used to log messages.
        Returns:
        the logger to be used to log messages.
      • processMessage

        public static void processMessage(MboRemote inboundComm)
                                   throws java.lang.Exception
        Process the message retrieved from mailserver in asynchronous way(non-JMS)
        Parameters:
        inboundComm - record
        Throws:
        java.lang.Exception
      • processMessage

        public static void processMessage(javax.jms.ObjectMessage objm)
                                   throws java.lang.Exception
        Process the message retrieved from mailserver
        Parameters:
        uniqueId -
        Throws:
        java.lang.Exception
      • handleErrorException

        public static void handleErrorException(java.lang.Exception e,
                                                java.lang.String emailAddress,
                                                MboRemote inboundComm)
                                         throws java.lang.Exception
        Handle error case with changing status,error column and sending e-mail
        Parameters:
        e -
        emailAddress -
        inboundComm -
        Throws:
        java.lang.Exception
      • updateInboundComm

        public static MboRemote updateInboundComm(java.lang.String[] attributeName,
                                                  java.lang.String[] value,
                                                  MboRemote oldInbComm)
                                           throws java.lang.Exception
        Update staging record with new value
        Parameters:
        attributeName -
        value -
        oldInbComm -
        Returns:
        new inboundcomm record
        Throws:
        java.lang.Exception
      • getInboundCommRecord

        public static MboRemote getInboundCommRecord(MboRemote oldInbComm)
                                              throws java.lang.Exception
        Returns a new staging mbo with all the information from old record
        Parameters:
        oldInbComm -
        Returns:
        staging mbo
        Throws:
        java.lang.Exception
      • processWorkFlow

        public static void processWorkFlow(MboRemote inboundComm,
                                           java.lang.String processName)
                                    throws java.lang.Exception
        Process workflow for the staging record
        Parameters:
        inboundComm -
        processName -
        Throws:
        java.lang.Exception
      • getCommTemplate

        public static MboRemote getCommTemplate(java.lang.String templateId,
                                                UserInfo ui)
                                         throws java.lang.Exception
        Get the comm template record
        Parameters:
        templateid -
        Returns:
        communication template mbo
        Throws:
        java.lang.Exception
      • sendEmail

        public static void sendEmail(java.lang.String messageStr,
                                     MboRemote ownMbo,
                                     java.lang.String sendTo,
                                     java.lang.String templateName)
                              throws java.lang.Exception
        Sends error email to more than one recipient
        Parameters:
        messageStr -
        ownMbo -
        sendTo -
        templateName -
        Throws:
        java.lang.Exception
      • sendEmail

        public static void sendEmail(MboRemote ownMbo,
                                     java.lang.String sendTo,
                                     java.lang.String templateName,
                                     java.lang.Throwable t)
                              throws java.lang.Exception
        Sends error email to more than one recipient
        Parameters:
        ownMbo -
        sendTo -
        templateName -
        t -
        Throws:
        java.lang.Exception
      • sendEmail

        public static void sendEmail(MboRemote ownMbo,
                                     java.lang.String sendTo,
                                     java.lang.String templateName,
                                     java.lang.String senderFrom,
                                     java.lang.String subject,
                                     java.util.Date receivedDate,
                                     java.lang.Throwable t)
                              throws java.lang.Exception
        Sends e-mail to sender/admin
        Parameters:
        ownMbo -
        sendTo -
        templateName -
        senderFrom -
        subject -
        receivedDate -
        t -
        Throws:
        java.lang.Exception
      • getMboSet

        public static MboSetRemote getMboSet(java.lang.String name,
                                             UserInfo ui)
                                      throws java.lang.Exception
        Returns a business object set based on the name of the business object.
        Parameters:
        name - name of the business object.
        Returns:
        a business object set based on the name of the business object.
        Throws:
        MXException - if fails to get the business object set.
        RemoteException - if fails to get the business object set.
        java.lang.Exception