org.cid.distribution.plugins.mail
Class MailWriterHandler

java.lang.Object
  extended by org.cid.distribution.base.MessageHandlerBase
      extended by org.cid.distribution.plugins.mail.MailWriterHandler
All Implemented Interfaces:
DistributionContextAware, MessageHandler

public class MailWriterHandler
extends MessageHandlerBase

This handler writes the message data to a file. If the path contains unexistent directories, they will be created.

This handler also allows accesing other filesystems using diferent types of URLs.

See @link http://jakarta.apache.org/commons/vfs/filesystems.html for more information on the filesystems wupported for writing and the way to access them.

The sequence %U can be used to create random filenames. Note that filenames generated this way do not preserve order when sorted alphabetically, though.

Version:
$Revision:111 $

Constructor Summary
MailWriterHandler()
          Class constructor.
 
Method Summary
static void addRules(org.apache.commons.digester.Digester d, java.lang.String patternPrefix)
          Configures additional rules for the commons-digester library.
 java.lang.String getAppend()
           
 DistributionMail getMail()
           
 java.lang.String getUrl()
           
 void init()
          The distribution container calls this method on all handlers before starting the distribution process.
 MessageEnumeration process(DistributionMessage message)
          Sends a message through this channel.
 void setAppend(java.lang.String append)
           
 void setMail(java.lang.String mail)
           
 void setUrl(java.lang.String url)
           
 
Methods inherited from class org.cid.distribution.base.MessageHandlerBase
destroy, getId, setDistributionContext, setId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailWriterHandler

public MailWriterHandler()
Class constructor.

Method Detail

init

public void init()
          throws DistributionProcessingException,
                 DistributionConfigurationException
Description copied from interface: MessageHandler
The distribution container calls this method on all handlers before starting the distribution process. This method will be called once for each handler. The order in which the handlers are created is not defined.

Specified by:
init in interface MessageHandler
Overrides:
init in class MessageHandlerBase
Throws:
DistributionProcessingException
DistributionConfigurationException

process

public MessageEnumeration process(DistributionMessage message)
                           throws DistributionProcessingException,
                                  DistributionConfigurationException
Sends a message through this channel.

Parameters:
message - The Message to send.
Returns:
The result of the handle processing, usually indicating whether the processing of this message has succeeded or failed.
Throws:
DistributionProcessingException
DistributionConfigurationException

addRules

public static void addRules(org.apache.commons.digester.Digester d,
                            java.lang.String patternPrefix)
Configures additional rules for the commons-digester library.


getUrl

public java.lang.String getUrl()
Returns:
Returns the filename.

setUrl

public void setUrl(java.lang.String url)
Parameters:
filename - The filename to set.

getAppend

public java.lang.String getAppend()
Returns:
Returns the append.

setAppend

public void setAppend(java.lang.String append)
Parameters:
append - The append to set.

getMail

public DistributionMail getMail()
Returns:
Returns the property.

setMail

public void setMail(java.lang.String mail)
Parameters:
property - The property to set.


Copyright © 2006 null. All Rights Reserved.