Class AlertProcessor

java.lang.Object
org.compiere.server.AdempiereServer
org.compiere.server.AlertProcessor
All Implemented Interfaces:
Runnable

public class AlertProcessor extends AdempiereServer
Alert Processor
Version:
$Id: AlertProcessor.java,v 1.4 2006/07/30 00:53:33 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
  • FR [ 1894573 ] Alert Processor Improvements
  • FR [ 2453882 ] Alert Processor : attached file name improvement, Kubotti
  • BF [ 2785633 ] Adding a Notice in Alert Processor
    • Field Details

      • m_model

        protected MAlertProcessor m_model
        The Concrete Model
      • m_summary

        protected StringBuffer m_summary
        Last Summary
      • m_errors

        protected StringBuffer m_errors
        Last Error Msg
      • m_client

        protected MClient m_client
        Client info
    • Constructor Details

      • AlertProcessor

        public AlertProcessor(MAlertProcessor model)
        Alert Processor
        Parameters:
        model - model
    • Method Details

      • doWork

        protected void doWork()
        Work
        Specified by:
        doWork in class AdempiereServer
      • processAlert

        protected boolean processAlert(MAlert alert, Language language)
        Process Alert
        Parameters:
        alert - alert
        Returns:
        true if processed
      • notifyUsers

        protected int notifyUsers(Collection<Integer> users, String subject, String message, Collection<File> attachments, MAlert alert)
        Notify users
        Parameters:
        users - AD_User_ID list
        subject - email subject
        message - email message
        attachments -
        alert -
        Returns:
        how many email were sent
      • getData

        protected ArrayList<ArrayList<Object>> getData(String sql, String trxName) throws Exception
        Get Alert Data
        Parameters:
        sql -
        trxName -
        Returns:
        data
        Throws:
        Exception
      • getPlainTextReport

        protected String getPlainTextReport(MAlertRule rule, String sql, String trxName, Collection<File> attachments) throws Exception
        Get Plain Text Report (old functionality)
        Parameters:
        rule - (ignored)
        sql - sql select
        trxName - transaction
        attachments - (ignored)
        Returns:
        list of rows and values
        Throws:
        Exception
      • getExcelReport

        protected String getExcelReport(MAlertRule rule, String sql, Language language, String trxName, Collection<File> attachments) throws Exception
        Get Excel Report
        Parameters:
        rule -
        sql -
        trxName -
        attachments -
        Returns:
        summary message to be added into mail content
        Throws:
        Exception
      • getServerInfo

        public String getServerInfo()
        Get Server Info
        Specified by:
        getServerInfo in class AdempiereServer
        Returns:
        info
      • findCloudStorage

        public static List<ICloudStorage> findCloudStorage(Integer COF_ArmazenamentoNuvem_ID, List<File> files)
        Parameters:
        COF_ArmazenamentoNuvem_ID -
        files -
        Returns: