psdi.common.asyncjob

Class AsyncJobHandler

  • java.lang.Object
    • psdi.common.asyncjob.AsyncJobHandler
    • Constructor Detail

      • AsyncJobHandler

        public AsyncJobHandler()
    • Method Detail

      • asyncProcess

        public abstract void asyncProcess(MXServer server,
                                          java.lang.String jobName,
                                          java.lang.String jobQueueNum,
                                          java.lang.String Object,
                                          UserInfo ui,
                                          java.lang.String whereClause,
                                          java.util.HashMap params)
                                   throws MXException,
                                          java.rmi.RemoteException
        Description copied from interface: AsyncJobHandlerInterface
        This method performs the Asynchronous operation. This method will be called by the asynchronous crontask. The user info passed in should be used as the user info to get any transaction or MBO sets. Save() should be called at the end of the method when process is successful.
        Specified by:
        asyncProcess in interface AsyncJobHandlerInterface
        jobName - The name of the job.
        jobQueueNum - The identifier of the job in the job queue.
        Object - The name of the main object that the async process is performed on.
        whereClause - The where clause applied on the main objects to identify one or more objects that the async process is performed on.
        params - A hash map of all the other parameters need to run the async job. The keys are the parameter names and the values are the MaxTypeObject
        Throws:
        MXException
        java.rmi.RemoteException
      • writeAsyncJobMsg

        public static void writeAsyncJobMsg(MXServer server,
                                            boolean sendEmail,
                                            java.lang.String emailAddress,
                                            UserInfo ui,
                                            java.lang.String jobName,
                                            java.lang.String jobQNum,
                                            java.lang.String msgLevel,
                                            java.lang.String message)
                                     throws MXException,
                                            java.rmi.RemoteException
        Write the message to the message table for the passed in asynchronous job. The data is committed right away.
        Parameters:
        server -
        jobName -
        jobQNum -
        msgLevel -
        message -
        Throws:
        MXException
        java.rmi.RemoteException
      • logSql

        public static void logSql(java.lang.String sql,
                                  java.sql.Connection con)
                           throws java.rmi.RemoteException,
                                  MXException
        Convenient method to log the sql
        Parameters:
        sql -
        con -
        Throws:
        java.rmi.RemoteException
        MXException
      • writeAsyncJobMsg

        public static void writeAsyncJobMsg(MXServer server,
                                            boolean email,
                                            java.lang.String emailAddress,
                                            UserInfo ui,
                                            java.lang.String jobName,
                                            java.lang.String jobQNum,
                                            java.lang.String msgLevel,
                                            MXException e)
                                     throws MXException,
                                            java.rmi.RemoteException
        Compose the message of the exception based on the user info and write as the message for this job. The UserInfo is only used to get the correct message, it is not involved in the database transaction.
        Parameters:
        server -
        ui -
        jobName -
        jobQNum -
        msgLevel -
        e -
        Throws:
        MXException
        java.rmi.RemoteException
      • sendAsyncJobEmail

        public static void sendAsyncJobEmail(MXServer server,
                                             java.lang.String emailAddress,
                                             UserInfo ui,
                                             java.lang.String level,
                                             java.lang.String jobName,
                                             java.lang.String jobNum,
                                             java.lang.String message)
      • writeAsyncJobMsg

        public static void writeAsyncJobMsg(MXServer server,
                                            boolean email,
                                            java.lang.String emailAddress,
                                            UserInfo ui,
                                            java.lang.String jobName,
                                            java.lang.String jobQNum,
                                            java.lang.String msgLevel,
                                            java.lang.String msgGrp,
                                            java.lang.String msgKey,
                                            java.lang.Object[] params)
                                     throws MXException,
                                            java.rmi.RemoteException
        Compose the message of the message group and key based on the user info and write as the message for this job. The UserInfo is only used to get the correct message, it is not involved in the database transaction.
        Parameters:
        server -
        ui -
        jobName -
        jobQNum -
        msgLevel -
        msgGrp -
        msgKey -
        params -
        Throws:
        MXException
        java.rmi.RemoteException