com.swiftmq.extension.javamail.outbound
Interface Transformer


public interface Transformer

Transformer interface for outbound mail bridges. For each message, the bridge calls "setMessage" with the JMS message. Thereafter it calls "getContent", "getNumberAttachments". For each attachment it calls "getAttachment" and "getAttachmentFilename". The index starts at 0.

Author:
IIT Software GmbH, Bremen/Germany, Copyright (c) 2012, All Rights Reserved

Method Summary
 javax.activation.DataSource getAttachment(int index)
          Returns a javax.activation.DataSource object to access the attachment.
 java.lang.String getAttachmentFilename(int index)
          Returns the filename of the attachment.
 java.lang.String getContent()
          Returns the content.
 int getNumberAttachments()
          Returns the number of attachments.
 void setMessage(MessageImpl message)
          Sets the JMS message.
 

Method Detail

setMessage

void setMessage(MessageImpl message)
                throws java.lang.Exception
Sets the JMS message. The type is SwiftMQ's message implementation. It can be casted to the appropriate javax.jms.Message type.

Parameters:
message - JMS message
Throws:
java.lang.Exception - on error, e.g. wrong message type

getContent

java.lang.String getContent()
                            throws java.lang.Exception
Returns the content. This content is set as the mail body with MIME type "text/plain".

Returns:
content
Throws:
java.lang.Exception - on error

getNumberAttachments

int getNumberAttachments()
                         throws java.lang.Exception
Returns the number of attachments.

Returns:
number of attachments
Throws:
java.lang.Exception - on error

getAttachment

javax.activation.DataSource getAttachment(int index)
                                          throws java.lang.Exception
Returns a javax.activation.DataSource object to access the attachment. See the JAF framework for details.

Parameters:
index - attachment index, starts at 0
Returns:
data source object
Throws:
java.lang.Exception - on error

getAttachmentFilename

java.lang.String getAttachmentFilename(int index)
                                       throws java.lang.Exception
Returns the filename of the attachment.

Parameters:
index - attachment index, starts at 0
Returns:
filename or null if no filename is specified
Throws:
java.lang.Exception - on error


Copyright © 2012 IIT Software GmbH, Bremen/Germany. All Rights Reserved.