org.apache.james.transport.mailets
Class AbstractAddFooter

java.lang.Object
  extended by org.apache.mailet.GenericMailet
      extended by org.apache.james.transport.mailets.AbstractAddFooter
All Implemented Interfaces:
Mailet, MailetConfig
Direct Known Subclasses:
AddFooter, CommandListservFooter

public abstract class AbstractAddFooter
extends GenericMailet

An abstract implementation of a mailet that add a Footer to an email


Constructor Summary
AbstractAddFooter()
           
 
Method Summary
protected  void addToHTML(javax.mail.internet.MimePart part)
          Prepends the content of the MimePart as HTML to the existing footer
protected  void addToText(javax.mail.internet.MimePart part)
          Prepends the content of the MimePart as text to the existing footer
protected  boolean attachFooter(javax.mail.internet.MimePart part)
          Attach a footer a MimePart
protected abstract  java.lang.String getFooterHTML()
          This is exposed as a method for easy subclassing to provide alternate ways to get the footer text.
protected abstract  java.lang.String getFooterText()
          This is exposed as a method for easy subclassing to provide alternate ways to get the footer text.
 void service(Mail mail)
          Takes the message and attaches a footer message to it.
 
Methods inherited from class org.apache.mailet.GenericMailet
destroy, getInitParameter, getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetInfo, getMailetName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAddFooter

public AbstractAddFooter()
Method Detail

service

public void service(Mail mail)
             throws javax.mail.MessagingException
Takes the message and attaches a footer message to it. Right now, it only supports simple messages. Needs to have additions to make it support messages with alternate content types or with attachments.

Specified by:
service in interface Mailet
Specified by:
service in class GenericMailet
Parameters:
mail - the mail being processed
Throws:
javax.mail.MessagingException - if an error arises during message processing

addToText

protected void addToText(javax.mail.internet.MimePart part)
                  throws javax.mail.MessagingException,
                         java.io.IOException
Prepends the content of the MimePart as text to the existing footer

Parameters:
part - the MimePart to attach
Throws:
javax.mail.MessagingException
java.io.IOException

addToHTML

protected void addToHTML(javax.mail.internet.MimePart part)
                  throws javax.mail.MessagingException,
                         java.io.IOException
Prepends the content of the MimePart as HTML to the existing footer

Parameters:
part - the MimePart to attach
Throws:
javax.mail.MessagingException
java.io.IOException

attachFooter

protected boolean attachFooter(javax.mail.internet.MimePart part)
                        throws javax.mail.MessagingException,
                               java.io.IOException
Attach a footer a MimePart

Parameters:
part - the MimePart to which the footer is to be attached
Returns:
whether a footer was successfully attached
Throws:
javax.mail.MessagingException
java.io.IOException

getFooterText

protected abstract java.lang.String getFooterText()
This is exposed as a method for easy subclassing to provide alternate ways to get the footer text.

Returns:
the footer text

getFooterHTML

protected abstract java.lang.String getFooterHTML()
This is exposed as a method for easy subclassing to provide alternate ways to get the footer text. By default, this will take the footer text, converting the linefeeds to <br> tags.

Returns:
the HTML version of the footer text


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.