Holger's
Java API

com.antelmann.util.logging
Class EmailWriter

java.lang.Object
  extended by com.antelmann.util.logging.AbstractLogWriter<String>
      extended by com.antelmann.util.logging.XMLLogWriter
          extended by com.antelmann.util.logging.EmailWriter
All Implemented Interfaces:
Filter<LogEntry>, LogWriter, Closeable

public class EmailWriter
extends XMLLogWriter

uses email to send each LogEntry object over the Internet. The body of each email message uses the XML format of the super class. As sending the email may take some time, you should consider using an AsynchLogWriter with this EmailWriter.

Author:
Holger Antelmann
See Also:
AsynchLogWriter, POP3Account

Field Summary
 
Fields inherited from class com.antelmann.util.logging.AbstractLogWriter
filter
 
Fields inherited from interface com.antelmann.util.Filter
EXCLUDE_ALL_FILTER, INCLUDE_ALL_FILTER
 
Constructor Summary
EmailWriter(POP3Account service, String toAddress)
           
EmailWriter(POP3Account service, String toAddress, String subjectLine)
           
 
Method Summary
 void setEmailProcessor(Processor<Email,RuntimeException> emailProcessor)
           
 void write(LogEntry entry)
          sends the email
 
Methods inherited from class com.antelmann.util.logging.XMLLogWriter
close, flush, getAlwaysFlush, getPrintStream, getPrintWriter, setAlwaysFlush, writeLogPattern
 
Methods inherited from class com.antelmann.util.logging.AbstractLogWriter
accept, getLogFilter, getLogFormatter, setLogFilter, setLogFormatter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailWriter

public EmailWriter(POP3Account service,
                   String toAddress)

EmailWriter

public EmailWriter(POP3Account service,
                   String toAddress,
                   String subjectLine)
Method Detail

setEmailProcessor

public void setEmailProcessor(Processor<Email,RuntimeException> emailProcessor)

write

public void write(LogEntry entry)
           throws LogException
sends the email

Specified by:
write in interface LogWriter
Overrides:
write in class AbstractLogWriter<String>
Throws:
LogException - if an error occurred while writing the log


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads