Jacson

de.spieleck.app.jacson.report
Class MailReport

java.lang.Object
  extended byde.spieleck.app.jacson.report.PrintingReport
      extended byde.spieleck.app.jacson.report.ValuePrintingReport
          extended byde.spieleck.app.jacson.report.MailReport
All Implemented Interfaces:
ConfigVerify.Acceptor, JacsonPrintReport, JacsonReport, JacsonStately

public class MailReport
extends ValuePrintingReport

Report which sends a mail. Since it is a sub class of PrintingReport it prints it output in the same way, only sending the text via mail to configurable receivers. The report uses a file to cache its content or stores the contents in memory. This depends whether the filename config parameter is given or not.

Author:
Patrick Carl

Field Summary
static java.lang.String DEFAULT_MAIL_PASSWORD
           
static java.lang.String DEFAULT_MAIL_SENDER
           
static java.lang.String DEFAULT_MAIL_USER
           
static java.lang.String DEFAULT_SMTP_SERVER_HOST
           
static int DEFAULT_SMTP_SERVER_PORT
           
static java.lang.String MAIL_PASSWORD_NODE
           
static java.lang.String MAIL_RECEIVERS_NODE
           
static java.lang.String MAIL_SENDER_NODE
           
static java.lang.String MAIL_SUBJECT_NODE
           
static java.lang.String MAIL_USER_NAME_NODE
           
static java.lang.String SEND_MAIL_NOW
           
static java.lang.String SMTP_SERVER_HOST_NODE
           
static java.lang.String SMTP_SERVER_PORT_NODE
           
 
Fields inherited from class de.spieleck.app.jacson.report.ValuePrintingReport
debug, DEBUG_NODE, secs, SECTION_NODE
 
Fields inherited from class de.spieleck.app.jacson.report.PrintingReport
begins, FILENAME_NODE, pw
 
Constructor Summary
MailReport()
          Creates a new instance of MailReport
 
Method Summary
 boolean accept(ConfigNode node)
           
 void finish(boolean close)
          finishes the Report and sends a mail
 void init(ConfigNode config)
          Initialize the report.
 void report(java.lang.String localName, java.lang.String value)
          Report a single name value pair within a report
protected  void useFilename(ConfigNode config)
           
 
Methods inherited from class de.spieleck.app.jacson.report.ValuePrintingReport
sectionMatch
 
Methods inherited from class de.spieleck.app.jacson.report.PrintingReport
begin, end, finish, getPrintWriter, getRegState, registerState, setOutputStream, setPrintWriter, useFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEND_MAIL_NOW

public static final java.lang.String SEND_MAIL_NOW
See Also:
Constant Field Values

SMTP_SERVER_HOST_NODE

public static final java.lang.String SMTP_SERVER_HOST_NODE
See Also:
Constant Field Values

SMTP_SERVER_PORT_NODE

public static final java.lang.String SMTP_SERVER_PORT_NODE
See Also:
Constant Field Values

MAIL_USER_NAME_NODE

public static final java.lang.String MAIL_USER_NAME_NODE
See Also:
Constant Field Values

MAIL_PASSWORD_NODE

public static final java.lang.String MAIL_PASSWORD_NODE
See Also:
Constant Field Values

MAIL_SENDER_NODE

public static final java.lang.String MAIL_SENDER_NODE
See Also:
Constant Field Values

MAIL_RECEIVERS_NODE

public static final java.lang.String MAIL_RECEIVERS_NODE
See Also:
Constant Field Values

MAIL_SUBJECT_NODE

public static final java.lang.String MAIL_SUBJECT_NODE
See Also:
Constant Field Values

DEFAULT_SMTP_SERVER_HOST

public static final java.lang.String DEFAULT_SMTP_SERVER_HOST
See Also:
Constant Field Values

DEFAULT_SMTP_SERVER_PORT

public static final int DEFAULT_SMTP_SERVER_PORT
See Also:
Constant Field Values

DEFAULT_MAIL_USER

public static final java.lang.String DEFAULT_MAIL_USER

DEFAULT_MAIL_PASSWORD

public static final java.lang.String DEFAULT_MAIL_PASSWORD

DEFAULT_MAIL_SENDER

public static final java.lang.String DEFAULT_MAIL_SENDER
See Also:
Constant Field Values
Constructor Detail

MailReport

public MailReport()
Creates a new instance of MailReport

Method Detail

report

public void report(java.lang.String localName,
                   java.lang.String value)
Description copied from interface: JacsonReport
Report a single name value pair within a report

Specified by:
report in interface JacsonReport
Overrides:
report in class ValuePrintingReport

finish

public void finish(boolean close)
finishes the Report and sends a mail

Specified by:
finish in interface JacsonReport
Overrides:
finish in class PrintingReport

init

public void init(ConfigNode config)
          throws JacsonConfigException
Description copied from interface: JacsonReport
Initialize the report. The passed ConfigNode can be used to obtain configuration information of the report from the global config xml.

Specified by:
init in interface JacsonReport
Overrides:
init in class ValuePrintingReport
Throws:
JacsonConfigException

accept

public boolean accept(ConfigNode node)
Specified by:
accept in interface ConfigVerify.Acceptor
Overrides:
accept in class ValuePrintingReport

useFilename

protected void useFilename(ConfigNode config)
                    throws JacsonConfigException
Overrides:
useFilename in class PrintingReport
Throws:
JacsonConfigException

Spieleck

Copyleft 2002 spieleck.de.