Package org.compiere.server
Class EMailProcessor
- java.lang.Object
-
- org.compiere.server.EMailProcessor
-
public class EMailProcessor extends Object
Request Mail Processor- Version:
- $Id: EMailProcessor.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDELIVERYProcess Delivery Confirmprotected static intERRORProcess Errorprotected static CLoggerlogLoggerprotected Stringm_hostEMail Host Parameterprotected Stringm_passPassword Parameterprotected javax.mail.Sessionm_sessionSessionprotected javax.mail.Storem_storeStoreprotected Stringm_userEMail User Parameterprotected static intREQUESTProcess Requestprotected static intWORKFLOWProcess Workflow
-
Constructor Summary
Constructors Constructor Description EMailProcessor(String host, String user, String password)EMail ProcessorEMailProcessor(MClient client)EMail Processor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddumpBody(javax.mail.Part p)Print Bodyprotected voiddumpEnvelope(javax.mail.Message m)Print Envelopeprotected StringgetDeliveredReportDetail(javax.mail.Part part)Get Delivered Report Detailprotected StringgetDeliveryReport(javax.mail.Part msg)Get Delivery Reportprotected StringgetMessage(javax.mail.Part msg)Get Messageprotected javax.mail.SessiongetSession()Get Sessionprotected javax.mail.StoregetStore()Get Storeprotected StringgetSubject(javax.mail.Message msg)Get Subjectstatic voidmain(String[] args)Main Testprotected static voidprintOut(String s)Printprotected intprocessInBox()Process InBoxprotected intprocessMessage(javax.mail.Message msg)Process MessageintprocessMessages()Process Messages in InBox
-
-
-
Field Detail
-
m_host
protected String m_host
EMail Host Parameter
-
m_user
protected String m_user
EMail User Parameter
-
m_pass
protected String m_pass
Password Parameter
-
m_session
protected javax.mail.Session m_session
Session
-
m_store
protected javax.mail.Store m_store
Store
-
log
protected static final CLogger log
Logger
-
ERROR
protected static final int ERROR
Process Error- See Also:
- Constant Field Values
-
REQUEST
protected static final int REQUEST
Process Request- See Also:
- Constant Field Values
-
WORKFLOW
protected static final int WORKFLOW
Process Workflow- See Also:
- Constant Field Values
-
DELIVERY
protected static final int DELIVERY
Process Delivery Confirm- See Also:
- Constant Field Values
-
-
Method Detail
-
processMessages
public int processMessages()
Process Messages in InBox- Returns:
- number of mails processed
-
getSession
protected javax.mail.Session getSession() throws ExceptionGet Session- Returns:
- Session
- Throws:
Exception
-
getStore
protected javax.mail.Store getStore() throws ExceptionGet Store- Returns:
- Store
- Throws:
Exception
-
processInBox
protected int processInBox() throws ExceptionProcess InBox- Returns:
- number of processed
- Throws:
Exception
-
processMessage
protected int processMessage(javax.mail.Message msg) throws ExceptionProcess Message- Parameters:
msg- message- Returns:
- Type of Message
- Throws:
Exception
-
getSubject
protected String getSubject(javax.mail.Message msg)
Get Subject- Parameters:
msg- message- Returns:
- subject or ""
-
getMessage
protected String getMessage(javax.mail.Part msg)
Get Message- Parameters:
msg- Message- Returns:
- message or ""
-
getDeliveryReport
protected String getDeliveryReport(javax.mail.Part msg)
Get Delivery Report- Parameters:
msg- message- Returns:
- delivery info or null
-
getDeliveredReportDetail
protected String getDeliveredReportDetail(javax.mail.Part part) throws Exception
Get Delivered Report Detail- Parameters:
part- Mime Type message/*- Returns:
- info or null
- Throws:
Exception
-
dumpEnvelope
protected void dumpEnvelope(javax.mail.Message m) throws ExceptionPrint Envelope- Parameters:
m- message- Throws:
Exception
-
dumpBody
protected void dumpBody(javax.mail.Part p) throws ExceptionPrint Body- Parameters:
p-- Throws:
Exception
-
printOut
protected static void printOut(String s)
Print- Parameters:
s- string
-
main
public static void main(String[] args)
Main Test- Parameters:
args- ignored
-
-