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: 825767 $

Constructor Summary
MailBinding()
           
MailBinding(HeaderFilterStrategy headerFilterStrategy)
           
MailBinding(HeaderFilterStrategy headerFilterStrategy, ContentTypeResolver contentTypeResolver)
           
 
Method Summary
protected  void addAttachmentsToMultipart(Message camelMessage, MimeMultipart multipart, String partDisposition)
           
protected  void addBodyToMultipart(Message camelMessage, MailConfiguration configuration, MimeMultipart activeMultipart)
           
protected  boolean addOutputAttachment(Message camelMessage, String attachmentFilename, DataHandler handler)
          Strategy to allow filtering of attachments which are put on the Mail message
protected  void appendAttachmentsFromCamel(MimeMessage mimeMessage, Message camelMessage, MailConfiguration configuration)
          Appends the Mail attachments from the Camel MailMessage
protected  void appendHeadersFromCamelMessage(MimeMessage mimeMessage, MailConfiguration configuration, 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)
           
protected  String populateContentType(MailEndpoint endpoint, MimeMessage mimeMessage, Exchange exchange)
           
 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)
          Deprecated. is renamed to addOutputAttachment. Will be removed in Camel 2.0.
 
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)

MailBinding

public MailBinding(HeaderFilterStrategy headerFilterStrategy,
                   ContentTypeResolver contentTypeResolver)
Method Detail

populateMailMessage

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

populateContentType

protected String populateContentType(MailEndpoint endpoint,
                                     MimeMessage mimeMessage,
                                     Exchange exchange)
                              throws MessagingException
Throws:
MessagingException

extractBodyFromMail

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


appendHeadersFromCamelMessage

protected void appendHeadersFromCamelMessage(MimeMessage mimeMessage,
                                             MailConfiguration configuration,
                                             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)
Deprecated. is renamed to addOutputAttachment. Will be removed in Camel 2.0.

Strategy to allow filtering of attachments which are put on the Mail message


addOutputAttachment

protected boolean addOutputAttachment(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)


Apache CAMEL