Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.3)

E15033-01


com.bea.wli.sb.sources
Class MessageContextSource

java.lang.Object
  extended by com.bea.wli.sb.sources.MessageContextSource

All Implemented Interfaces:
Source

public class MessageContextSource
extends java.lang.Object
implements Source

Source that represents all message content. The Source for the message and attachments are left untyped to allow for deferred processing. Eventually, however, the attachments source will likely be converted into an AttachmentsSource and the message source will likely be converted to a specific typed source such as an XmlObjectSource or a StringSource. <p/> Note that the serialization format of a MessageContextSource is always a MIME multipart/related package, irrespective of the "native" serializations of the message and attachment sources. However, if this serialized is needed more than once, it is best to transform the Source into a MimeSource.


Field Summary
static java.lang.String MIME_BOUNDARY
          The default MIME_Boundary and name of TransformOptions option

 

Fields inherited from interface com.bea.wli.sb.sources.Source
DEFAULT_CHARACTER_SET_ENCODING

 

Method Summary
 Source getAttachments()
           
 java.lang.String getContentType()
           
 java.io.InputStream getInputStream(TransformOptions options)
          Returns streaming byte-baseed representation of the Source's content.
static MessageContextSource getInstance(javax.mail.internet.ContentType contentType, Headers messageHeaders, Source message)
           
static MessageContextSource getInstance(javax.mail.internet.ContentType contentType, Headers messageHeaders, Source message, Source attachments)
           
static MessageContextSource getInstance(java.lang.String contentType, Headers messageHeaders, Source message)
           
static MessageContextSource getInstance(java.lang.String contentType, Headers messageHeaders, Source message, Source attachments)
           
 Source getMessage()
           
 Headers getMessageHeaders()
           
 boolean isMultipart()
           
 boolean isXop()
           
 void writeTo(java.io.OutputStream os, TransformOptions options)
          Serializes the Source's content to a byte-based stream.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

MIME_BOUNDARY

public static final java.lang.String MIME_BOUNDARY
The default MIME_Boundary and name of TransformOptions option
See Also:
Constant Field Values

Method Detail

getInstance

public static MessageContextSource getInstance(java.lang.String contentType,
                                               Headers messageHeaders,
                                               Source message)
                                        throws java.io.IOException
Throws:
java.io.IOException

getInstance

public static MessageContextSource getInstance(java.lang.String contentType,
                                               Headers messageHeaders,
                                               Source message,
                                               Source attachments)
                                        throws java.io.IOException
Throws:
java.io.IOException

getInstance

public static MessageContextSource getInstance(javax.mail.internet.ContentType contentType,
                                               Headers messageHeaders,
                                               Source message)

getInstance

public static MessageContextSource getInstance(javax.mail.internet.ContentType contentType,
                                               Headers messageHeaders,
                                               Source message,
                                               Source attachments)

getContentType

public java.lang.String getContentType()
Returns:
the content type string for the message contents, e.g. "text/xml" or "multipart/related;boundary=\"----=_Part_0_15040737.1220438758687\";type=\"text/xml\";start=\"<soapPart>\"";

getMessageHeaders

public Headers getMessageHeaders()
Returns:
the set of MIME headers associated with the message

getMessage

public Source getMessage()
Returns:
the contents of the main part message (no headers or attachments) as a Source

getAttachments

public Source getAttachments()
Returns:
the message attachments, if any, as a Source

isMultipart

public boolean isMultipart()
Returns:
whether or not the message is a MIME multipart message

isXop

public boolean isXop()
Returns:
whether or not the message represents an XOP/MTOM serialized package

getInputStream

public java.io.InputStream getInputStream(TransformOptions options)
                                   throws java.io.IOException,
                                          TransformException
Description copied from interface: Source
Returns streaming byte-baseed representation of the Source's content. The representation of that serialization is entirely up to the Source. Note that this method may involve an internal transformation, although it should not in any way change the underlying content.
Specified by:
getInputStream in interface Source
Parameters:
options - Options used to affect the serialization
Returns:
an InputStream for retrieving the serialized content
Throws:
java.io.IOException
TransformException

writeTo

public void writeTo(java.io.OutputStream os,
                    TransformOptions options)
             throws java.io.IOException,
                    TransformException
Description copied from interface: Source
Serializes the Source's content to a byte-based stream. The representation of that serialization is entirely up to the Source. The Source is forbidden from closing the provided OutputStream, although it is allowed to flush it. However, flushing the stream should be left to the caller, if possible. <p/> Note that this method may involve an internal transformation, although it should not in any way change the underlying content.
Specified by:
writeTo in interface Source
Parameters:
os - the OutputStream to which serialized content will be written
options - TransformOptions used to affect the serialization
Throws:
java.io.IOException
TransformException

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.3)

E15033-01


Copyright © 2008, 2010, Oracle. All rights reserved.