Package org.compiere.server
Class AlertProcessor
java.lang.Object
org.compiere.server.AdempiereServer
org.compiere.server.AlertProcessor
- All Implemented Interfaces:
Runnable
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 Summary
Modifier and TypeFieldDescriptionprotected MClient
Client infoprotected StringBuffer
Last Error Msgprotected MAlertProcessor
The Concrete Modelprotected StringBuffer
Last SummaryFields inherited from class org.compiere.server.AdempiereServer
log, m_sleepMS, m_start, p_client, p_model, p_runCount, p_startWork, p_system
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doWork()
WorkGet Alert Dataprotected String
getExcelReport
(MAlertRule rule, String sql, Language language, String trxName, Collection<File> attachments) Get Excel Reportprotected String
getPlainTextReport
(MAlertRule rule, String sql, String trxName, Collection<File> attachments) Get Plain Text Report (old functionality)Get Server Infoprotected int
notifyUsers
(Collection<Integer> users, String subject, String message, Collection<File> attachments, MAlert alert) Notify usersprotected boolean
processAlert
(MAlert alert, Language language) Process AlertMethods inherited from class org.compiere.server.AdempiereServer
doRun, doRunNow, getCtx, getDateLastRun, getDateNextRun, getDescription, getInitialNap, getLogs, getModel, getName, getSecondsAlive, getServerID, getSleepMS, getStartTime, getStatistics, isInterrupted, isOKtoRunOnIP, isSleeping, recalculateSleepMS, run, runNow, toString
-
Field Details
-
m_model
The Concrete Model -
m_summary
Last Summary -
m_errors
Last Error Msg -
m_client
Client info
-
-
Constructor Details
-
AlertProcessor
Alert Processor- Parameters:
model
- model
-
-
Method Details
-
doWork
protected void doWork()Work- Specified by:
doWork
in classAdempiereServer
-
processAlert
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 listsubject
- email subjectmessage
- email messageattachments
-alert
-- Returns:
- how many email were sent
-
getData
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 selecttrxName
- transactionattachments
- (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
Get Server Info- Specified by:
getServerInfo
in classAdempiereServer
- Returns:
- info
-