org.apache.james.transport.mailets
Class GenericListserv

java.lang.Object
  extended by org.apache.mailet.GenericMailet
      extended by org.apache.james.transport.mailets.GenericListserv
All Implemented Interfaces:
Mailet, MailetConfig
Direct Known Subclasses:
AvalonListserv, JDBCListserv

public abstract class GenericListserv
extends GenericMailet

An abstract implementation of a listserv. The underlying implementation must define various settings, and can vary in their individual configuration. Supports restricting to members only, allowing attachments or not, sending replies back to the list, and an optional subject prefix.


Constructor Summary
GenericListserv()
           
 
Method Summary
 MailAddress getListservAddress()
          The email address that this listserv processes on.
abstract  java.util.Collection getMembers()
          Returns a Collection of MailAddress objects of members to receive this email
abstract  java.lang.String getSubjectPrefix()
          An optional subject prefix.
abstract  boolean isAttachmentsAllowed()
          Returns whether this listserv allow attachments
abstract  boolean isMembersOnly()
          Returns whether this list should restrict to senders only
 boolean isPrefixAutoBracketed()
          Should the subject prefix be automatically surrounded by [].
abstract  boolean isReplyToList()
          Returns whether listserv should add reply-to header
 void service(Mail mail)
          Processes the message.
 
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

GenericListserv

public GenericListserv()
Method Detail

getMembers

public abstract java.util.Collection getMembers()
                                         throws javax.mail.MessagingException
Returns a Collection of MailAddress objects of members to receive this email

Throws:
javax.mail.MessagingException

isMembersOnly

public abstract boolean isMembersOnly()
                               throws javax.mail.MessagingException
Returns whether this list should restrict to senders only

Throws:
javax.mail.MessagingException

isAttachmentsAllowed

public abstract boolean isAttachmentsAllowed()
                                      throws javax.mail.MessagingException
Returns whether this listserv allow attachments

Throws:
javax.mail.MessagingException

isReplyToList

public abstract boolean isReplyToList()
                               throws javax.mail.MessagingException
Returns whether listserv should add reply-to header

Throws:
javax.mail.MessagingException

getListservAddress

public MailAddress getListservAddress()
                               throws javax.mail.MessagingException
The email address that this listserv processes on. If returns null, will use the recipient of the message, which hopefully will be the correct email address assuming the matcher was properly specified.

Throws:
javax.mail.MessagingException

getSubjectPrefix

public abstract java.lang.String getSubjectPrefix()
                                           throws javax.mail.MessagingException
An optional subject prefix.

Throws:
javax.mail.MessagingException

isPrefixAutoBracketed

public boolean isPrefixAutoBracketed()
                              throws javax.mail.MessagingException
Should the subject prefix be automatically surrounded by [].

Returns:
whether the subject prefix will be surrounded by []
Throws:
javax.mail.MessagingException - never, for this implementation

service

public final void service(Mail mail)
                   throws javax.mail.MessagingException
Processes the message. Assumes it is the only recipient of this forked message.

Specified by:
service in interface Mailet
Specified by:
service in class GenericMailet
Parameters:
mail - - the Mail object that contains the MimeMessage and routing information
Throws:
javax.mail.MessagingException - - if an exception occurs that interferes with the mailet's normal operation


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.