Main: Whitepaper FAQ Examples JavaDoc Classloader Performance
Protomatter Software v1.1.8

com.protomatter.syslog
Class MailLog

java.lang.Object
  |
  +--com.protomatter.syslog.BasicLogger
        |
        +--com.protomatter.syslog.MailLog
All Implemented Interfaces:
Syslogger

public class MailLog
extends BasicLogger

A logger that sends email.

See Also:
XML configuration class

Fields inherited from class com.protomatter.syslog.BasicLogger
formatter, policy, realPolicy
 
Constructor Summary
MailLog()
          You will need to call the configure() method if you use this constructor.
MailLog(java.lang.String workQueueName, java.lang.String smtpServer)
          Create a new mail log that communicates with the given SMTP on port 25.
MailLog(java.lang.String workQueueName, java.lang.String smtpServer, int port)
          Create a new mail log that communicates with the given SMTP on the given port.
 
Method Summary
 void flush()
          Flush the given logger's output.
 java.util.Vector getBCC()
          Get the list of email addresses which appear in the "Bcc:" header.
 java.util.Vector getCC()
          Get the list of email addresses which appear in the "Cc:" header.
 java.lang.String getFromAddress()
          Get the email address the message will appear to come from.
 java.lang.String getFromName()
          Get the human-readable name that the message will appear to be from.
 boolean getHTML()
          Get the html-email flag.
 int getMailPort()
          Get the port to use on the mail server.
 java.lang.String getMailServer()
          Get the hostname of the mail server to use.
 SyslogMailSubjectFormatter getSubjectFormatter()
          Get the message subject formatter.
 java.util.Vector getTo()
          Get the list of email addresses which appear in the "To:" header.
 java.lang.String getTransportAgent()
          Get the transport agent name.
 java.lang.String getWorkQueue()
          Get the name of the work queue that this logger will actually do work in.
 void init()
           
 void log(SyslogMessage message)
          Log a message.
 void setBCC(java.util.Vector list)
          Set the list of email addresses which appear in the "Bcc:" header.
 void setCC(java.util.Vector list)
          Set the list of email addresses which appear in the "Cc:" header.
 void setFromAddress(java.lang.String fromAddress)
          Set the email address the message will appear to come from.
 void setFromName(java.lang.String fromName)
          Set the human-readable name that the message will appear to be from.
 void setHTML(boolean html)
          Set the html-email flag.
 void setMailPort(int port)
          Set the port to use on the mail server.
 void setMailServer(java.lang.String mailServer)
          Set the hostname of the mail server to use.
 void setSubjectFormatter(SyslogMailSubjectFormatter subjectFormat)
          Set the message subject formatter.
 void setTo(java.util.Vector list)
          Set the list of email addresses which appear in the "To:" header.
 void setTransportAgent(java.lang.String agentName)
          Set the transport agent name.
 void setWorkQueue(java.lang.String workQueue)
          Set the name of the work queue that this logger will actually do work in.
 void shutdown()
          Closes down the file and prepares for shutdown.
 
Methods inherited from class com.protomatter.syslog.BasicLogger
formatLogEntry, getName, getPolicy, getTextFormatter, isSuspended, mightLog, resetDateFormat, resume, setName, setPolicy, setTextFormatter, shouldLog, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailLog

public MailLog(java.lang.String workQueueName,
               java.lang.String smtpServer)
Create a new mail log that communicates with the given SMTP on port 25.

MailLog

public MailLog(java.lang.String workQueueName,
               java.lang.String smtpServer,
               int port)
Create a new mail log that communicates with the given SMTP on the given port.

MailLog

public MailLog()
You will need to call the configure() method if you use this constructor.
Method Detail

setTransportAgent

public void setTransportAgent(java.lang.String agentName)
Set the transport agent name.

getTransportAgent

public java.lang.String getTransportAgent()
Get the transport agent name.

setFromName

public void setFromName(java.lang.String fromName)
Set the human-readable name that the message will appear to be from.

getFromName

public java.lang.String getFromName()
Get the human-readable name that the message will appear to be from.

setFromAddress

public void setFromAddress(java.lang.String fromAddress)
Set the email address the message will appear to come from.

getFromAddress

public java.lang.String getFromAddress()
Get the email address the message will appear to come from.

setMailServer

public void setMailServer(java.lang.String mailServer)
Set the hostname of the mail server to use.

getMailServer

public java.lang.String getMailServer()
Get the hostname of the mail server to use.

setMailPort

public void setMailPort(int port)
Set the port to use on the mail server. Default is 25.

getMailPort

public int getMailPort()
Get the port to use on the mail server.

setHTML

public void setHTML(boolean html)
Set the html-email flag. Default is false.

getHTML

public boolean getHTML()
Get the html-email flag.

setTo

public void setTo(java.util.Vector list)
Set the list of email addresses which appear in the "To:" header.

getTo

public java.util.Vector getTo()
Get the list of email addresses which appear in the "To:" header.

setCC

public void setCC(java.util.Vector list)
Set the list of email addresses which appear in the "Cc:" header.

getCC

public java.util.Vector getCC()
Get the list of email addresses which appear in the "Cc:" header.

setBCC

public void setBCC(java.util.Vector list)
Set the list of email addresses which appear in the "Bcc:" header.

getBCC

public java.util.Vector getBCC()
Get the list of email addresses which appear in the "Bcc:" header.

setWorkQueue

public void setWorkQueue(java.lang.String workQueue)
Set the name of the work queue that this logger will actually do work in. If it is null, everything will be done synchronously.

getWorkQueue

public java.lang.String getWorkQueue()
Get the name of the work queue that this logger will actually do work in. If this return null, everything will be done synchronously.

setSubjectFormatter

public void setSubjectFormatter(SyslogMailSubjectFormatter subjectFormat)
Set the message subject formatter.

getSubjectFormatter

public SyslogMailSubjectFormatter getSubjectFormatter()
Get the message subject formatter.

log

public final void log(SyslogMessage message)
Log a message.

shutdown

public void shutdown()
Closes down the file and prepares for shutdown.

init

public void init()

flush

public void flush()
Description copied from interface: Syslogger
Flush the given logger's output.

Protomatter Software v1.1.8
Copyright 1998-2002 Nate Sammons

Protomatter Software v1.1.8 http://protomatter.sourceforge.net/1.1.8