org.apache.camel.component.mail
Class MailBinding

java.lang.Object
  extended by org.apache.camel.component.mail.MailBinding

public class MailBinding
extends Object

A Strategy used to convert between a Camel Exchange and Message to and from a Mail MimeMessage

Version:
$Revision: 760920 $

Constructor Summary
MailBinding()
           
MailBinding(HeaderFilterStrategy headerFilterStrategy)
           
 
Method Summary
protected  void addAttachmentsToMultipart(Message camelMessage, MimeMultipart multipart, String partDisposition)
           
protected  void addBodyToMultipart(Message camelMessage, MailConfiguration configuration, MimeMultipart activeMultipart)
           
protected  void appendAttachmentsFromCamel(MimeMessage mimeMessage, Message camelMessage, MailConfiguration configuration)
          Appends the Mail attachments from the Camel MailMessage
protected  void appendHeadersFromCamelMessage(MimeMessage mimeMessage, Exchange exchange, Message camelMessage)
          Appends the Mail headers from the Camel MailMessage
protected  void createMultipartAlternativeMessage(MimeMessage mimeMessage, Message camelMessage, MailConfiguration configuration)
           
 Object extractBodyFromMail(MailExchange exchange, Message message)
          Extracts the body from the Mail message
protected  Map<String,Object> extractHeadersFromMail(Message mailMessage)
           
protected static String getAlternativeBody(MailConfiguration configuration, Message camelMessage)
           
protected static boolean hasAlternativeBody(MailConfiguration configuration, Message camelMessage)
           
 void populateMailMessage(MailEndpoint endpoint, MimeMessage mimeMessage, Exchange exchange)
           
protected  void setRecipientFromEndpointConfiguration(MimeMessage mimeMessage, MailEndpoint endpoint)
          Appends the Mail headers from the endpoint configuraiton.
protected  boolean shouldOutputAttachment(Message camelMessage, String attachmentFilename, DataHandler handler)
          Strategy to allow filtering of attachments which are put on the Mail message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailBinding

public MailBinding()

MailBinding

public MailBinding(HeaderFilterStrategy headerFilterStrategy)
Method Detail

populateMailMessage

public void populateMailMessage(MailEndpoint endpoint,
                                MimeMessage mimeMessage,
                                Exchange exchange)
                         throws MessagingException,
                                IOException
Throws:
MessagingException
IOException

extractBodyFromMail

public Object extractBodyFromMail(MailExchange exchange,
                                  Message message)
Extracts the body from the Mail message


appendHeadersFromCamelMessage

protected void appendHeadersFromCamelMessage(MimeMessage mimeMessage,
                                             Exchange exchange,
                                             Message camelMessage)
                                      throws MessagingException
Appends the Mail headers from the Camel MailMessage

Throws:
MessagingException

setRecipientFromEndpointConfiguration

protected void setRecipientFromEndpointConfiguration(MimeMessage mimeMessage,
                                                     MailEndpoint endpoint)
                                              throws MessagingException
Appends the Mail headers from the endpoint configuraiton.

Throws:
MessagingException

appendAttachmentsFromCamel

protected void appendAttachmentsFromCamel(MimeMessage mimeMessage,
                                          Message camelMessage,
                                          MailConfiguration configuration)
                                   throws MessagingException
Appends the Mail attachments from the Camel MailMessage

Throws:
MessagingException

addAttachmentsToMultipart

protected void addAttachmentsToMultipart(Message camelMessage,
                                         MimeMultipart multipart,
                                         String partDisposition)
                                  throws MessagingException
Throws:
MessagingException

createMultipartAlternativeMessage

protected void createMultipartAlternativeMessage(MimeMessage mimeMessage,
                                                 Message camelMessage,
                                                 MailConfiguration configuration)
                                          throws MessagingException
Throws:
MessagingException

addBodyToMultipart

protected void addBodyToMultipart(Message camelMessage,
                                  MailConfiguration configuration,
                                  MimeMultipart activeMultipart)
                           throws MessagingException
Throws:
MessagingException

shouldOutputAttachment

protected boolean shouldOutputAttachment(Message camelMessage,
                                         String attachmentFilename,
                                         DataHandler handler)
Strategy to allow filtering of attachments which are put on the Mail message


extractHeadersFromMail

protected Map<String,Object> extractHeadersFromMail(Message mailMessage)
                                             throws MessagingException
Throws:
MessagingException

hasAlternativeBody

protected static boolean hasAlternativeBody(MailConfiguration configuration,
                                            Message camelMessage)

getAlternativeBody

protected static String getAlternativeBody(MailConfiguration configuration,
                                           Message camelMessage)


Copyright © 2009 Apache Software Foundation. All Rights Reserved.