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
FieldsModifier and TypeFieldDescriptionprotected MClientClient infoprotected StringBufferLast Error Msgprotected MAlertProcessorThe Concrete Modelprotected StringBufferLast 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoWork()WorkGet Alert Dataprotected StringgetExcelReport(MAlertRule rule, String sql, Language language, String trxName, Collection<File> attachments) Get Excel Reportprotected StringgetPlainTextReport(MAlertRule rule, String sql, String trxName, Collection<File> attachments) Get Plain Text Report (old functionality)Get Server Infoprotected intnotifyUsers(Collection<Integer> users, String subject, String message, Collection<File> attachments, MAlert alert) Notify usersprotected booleanprocessAlert(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:
doWorkin 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:
getServerInfoin classAdempiereServer- Returns:
- info
-