org.apache.james.transport.mailets
Class AbstractVirtualUserTable

java.lang.Object
  extended by org.apache.mailet.GenericMailet
      extended by org.apache.james.transport.mailets.AbstractVirtualUserTable
All Implemented Interfaces:
Mailet, MailetConfig
Direct Known Subclasses:
JDBCVirtualUserTable, XMLVirtualUserTable

public abstract class AbstractVirtualUserTable
extends GenericMailet

Provides an abstraction of common functionality needed for implementing a Virtual User Table. Override the mapRecipients method to map virtual recipients to real recipients.


Constructor Summary
AbstractVirtualUserTable()
           
 
Method Summary
protected abstract  void mapRecipients(java.util.Map recipientsMap)
          Override to map virtual recipients to real recipients, both local and non-local.
 void service(Mail mail)
          Checks the recipient list of the email for user mappings.
 
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

AbstractVirtualUserTable

public AbstractVirtualUserTable()
Method Detail

service

public void service(Mail mail)
             throws javax.mail.MessagingException
Checks the recipient list of the email for user mappings. Maps recipients as appropriate, modifying the recipient list of the mail and sends mail to any new non-local recipients.

Specified by:
service in interface Mailet
Specified by:
service in class GenericMailet
Parameters:
mail - the mail to process
Throws:
javax.mail.MessagingException - - if an exception occurs that interferes with the mailet's normal operation

mapRecipients

protected abstract void mapRecipients(java.util.Map recipientsMap)
                               throws javax.mail.MessagingException
Override to map virtual recipients to real recipients, both local and non-local. Each key in the provided map corresponds to a potential virtual recipient, stored as a MailAddress object. Translate virtual recipients to real recipients by mapping a string containing the address of the real recipient as a value to a key. Leave the value null if no mapping should be performed. Multiple recipients may be specified by delineating the mapped string with commas, semi-colons or colons.

Parameters:
recipientsMap - the mapping of virtual to real recipients, as MailAddresses to Strings.
Throws:
javax.mail.MessagingException


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