|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.mule.providers.AbstractMessageAdapter
org.mule.providers.email.SimpleMailMessageAdapter
SimpleMailMessageAdapter is an adapter for mail messages.
Unlike MailMessageAdapter this preserves the message intact in its original
form.
Header values are stored in two formats. First, as historically used by
MailMessageAdapter, a single String value is stored for each distinct
header name (if a header is repeated only one value is stored).
Secondly, a list of values for each distinct header is stored in a property name
prefixed by HEADER_LIST_PREFIX
(which produces an invalid header name according to RFC 822 and so (i) avoids
conflict with the first property type and (ii) will cause current applications
that wrongly assume all properties are simple header values to fail fast).
The utility methods
isListHeader(String), toHeader(String) and
toListHeader(String) identify and convert between property and
header names as required.
| Field Summary | |
static String |
HEADER_LIST_PREFIX
|
| Fields inherited from class org.mule.providers.AbstractMessageAdapter |
attachments, DEFAULT_FAILFAST, encoding, exceptionPayload, id, logger, properties |
| Fields inherited from interface org.mule.impl.ThreadSafeAccess |
READ, WRITE |
| Constructor Summary | |
|
SimpleMailMessageAdapter(Object object)
|
protected |
SimpleMailMessageAdapter(SimpleMailMessageAdapter template)
|
| Method Summary | |
Object |
getPayload()
|
byte[] |
getPayloadAsBytes()
|
String |
getPayloadAsString(String encoding)
|
protected void |
handleMessage(Message message)
By default, this simply stores the entire message as a single message. |
static boolean |
isListHeader(String name)
Check whether a property name has the format associated with a list of header values |
org.mule.impl.ThreadSafeAccess |
newThreadCopy()
|
protected void |
setMessage(Part message)
|
static String |
toHeader(String name)
Convert a property name associated with a list of header values to the relevant header name (ie drop the prefix) |
static String |
toListHeader(String header)
Convert a header name to the property name associated with a list of header values (ie prepend the prefix) |
| Methods inherited from class org.mule.providers.AbstractMessageAdapter |
addAttachment, addInboundProperties, addProperties, assertAccess, clearProperties, getAttachment, getAttachmentNames, getBooleanProperty, getCorrelationGroupSize, getCorrelationId, getCorrelationSequence, getDoubleProperty, getEncoding, getExceptionPayload, getIntProperty, getLongProperty, getProperty, getProperty, getPropertyNames, getReplyTo, getStringProperty, getUniqueId, isDisabled, newException, release, removeAttachment, removeProperty, resetAccessControl, setBooleanProperty, setCorrelationGroupSize, setCorrelationId, setCorrelationSequence, setDoubleProperty, setEncoding, setExceptionPayload, setIntProperty, setLongProperty, setProperty, setProperty, setReplyTo, setStringProperty, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String HEADER_LIST_PREFIX
| Constructor Detail |
public SimpleMailMessageAdapter(Object object)
throws org.mule.umo.MessagingException
protected SimpleMailMessageAdapter(SimpleMailMessageAdapter template)
| Method Detail |
protected void handleMessage(Message message)
throws Exception
Exceptionprotected void setMessage(Part message)
public Object getPayload()
public byte[] getPayloadAsBytes()
throws Exception
Exception
public String getPayloadAsString(String encoding)
throws Exception
Exceptionpublic static boolean isListHeader(String name)
name - A property name
public static String toHeader(String name)
name - A property name
public static String toListHeader(String header)
header - A header name
public org.mule.impl.ThreadSafeAccess newThreadCopy()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||