Sonic ESB API

com.sonicsw.xq
Interface XQPart

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable, XQCloneable

public interface XQPart
extends XQCloneable, java.io.Serializable

The XQPart is a part of a XQMessage. Each part has an associated Header and Content.

The Header contains header fields, such as Content-Type and Content-Id.

The content of the part is accessed either directly as an Object or through a javax.activation.DataHandler.


Method Summary
 java.lang.Object getContent()
          Gets the content of the part as an Object.
 java.lang.String getContentId()
          Gets the content-id from the part header.
 java.lang.String getContentType()
          Gets the Content-Type from the part header.
 javax.activation.DataHandler getDataHandler()
          This method provides the mechanism to get this part's content.
 XQHeader getHeader()
          Gets the Header for the Part.
 void setContent(java.lang.Object content, java.lang.String type)
          Set the content for this part.
 void setContentId(java.lang.String id)
          Sets the Content-Id header value in the part header.
 void setDataHandler(javax.activation.DataHandler dataHandler)
          This method provides the mechanism to set this part's content.
 
Methods inherited from interface com.sonicsw.xq.XQCloneable
clone
 

Method Detail

getHeader

XQHeader getHeader()
Gets the Header for the Part. The Header provides access to the header fields as name/value pairs.

Returns:
The header for this part

getContentId

java.lang.String getContentId()
Gets the content-id from the part header. This is a convenience method for accessing the content-id directly.

Returns:
The content-id for this part

setContentId

void setContentId(java.lang.String id)
Sets the Content-Id header value in the part header.

Parameters:
id - The value of the Content-Id

setContent

void setContent(java.lang.Object content,
                java.lang.String type)
Set the content for this part. The part will initial attempt to wrap the content in a DataHandler. If that fails the content will be handled as a Object.

Note that a DataContentHandler class for the specified type should be available for this to work right. i.e., to do setContent(mycontents, "application/x-mytype"), a DataContentHandler for "application/x-mytype" should be installed.

Refer to the Java Activation Framework for more information.

Parameters:
content - A Java Object.
type - The Content-Type of this object

getContent

java.lang.Object getContent()
Gets the content of the part as an Object.

Returns:
The Object.

getContentType

java.lang.String getContentType()
Gets the Content-Type from the part header. This is a convenience method for accessing the Content-Type directly. Returns null if the Content-Type could not be determined.

Returns:
The Content-Type of the part.

getDataHandler

javax.activation.DataHandler getDataHandler()
This method provides the mechanism to get this part's content. The DataHandler wraps around the actual content.

Returns:
DataHandler for the Part.

setDataHandler

void setDataHandler(javax.activation.DataHandler dataHandler)
This method provides the mechanism to set this part's content. The DataHandler wraps around the actual content.

Parameters:
dataHandler - The DataHandler.

Sonic ESB API

Copyright © 2001-2012 Progress Software Corporation. All Rights Reserved.
HTML formatted on 13-Mar-2012.