|
SonicMQ API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MultipartMessage
The MultipartMessage is a message that can contain one or more Parts. It provides methods to add, delete, and get the constituent parts. The Parts can be javax.jms.Message implementations in addition to primitive types such as xml, html, text, etc.
When a JMS client receives a MulitpartMessage, it is in read-only mode. If a
client attempts to write to the message at this point, a
javax.jms.MessageNotWriteableException
is thrown. If clearBody
is
called, the message can now be both read from and written to.
The Parts of a MultipartMessage are accessible two ways. The accessor methods on Parts are accessible two ways:
Message
Field Summary |
---|
Fields inherited from interface javax.jms.Message |
---|
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
Method Summary | |
---|---|
void |
addPart(Part part)
Adds a part to the multipart. |
void |
clearReadOnly()
Makes a message writable. |
Part |
createMessagePart(Message message)
Creates a part whose content is a Message. |
Part |
createPart()
Creates an empty part. |
Part |
createPart(javax.activation.DataHandler handler)
Creates a Part from a DataHandler. |
Part |
createPart(java.lang.Object object,
java.lang.String type)
Creates a part. |
boolean |
doesPartExist(java.lang.String cid)
Checks if a Part with the given content-id exists |
Message |
getMessageFromPart(int index)
convenience method to retrieve a Message from the multipart |
Message |
getMessageFromPart(java.lang.String cid)
Convenience method to retrieve a Message from the multipart |
Part |
getPart(int index)
Gets the Part from the MultipartMessage by index |
Part |
getPart(java.lang.String cid)
Gets an Part from the message based on the content-id property of the Part. |
int |
getPartCount()
Gets the count of the number of Parts for the MultipartMessage. |
java.lang.String |
getProfileName()
Return the name of the extended type, or profile, used to create this message. |
boolean |
isMessagePart(int index)
Checks if the Part is a MessagePart |
boolean |
isMessagePart(java.lang.String cid)
Checks if the Part is a MessagePart |
boolean |
isReadOnly()
Checks if the message is in read-only mode. |
void |
removePart(int index)
Removes a Part from the Multipart. |
void |
removePart(java.lang.String cid)
Removes a Part from the Multipart. |
Methods inherited from interface progress.message.jclient.Message |
---|
acknowledgeAndForward, acknowledgeAndForward, getBodySize, getChannel, getDestinationProperty, getProperties, hasChannel, isDestinationProperty, setChannel, setChannel, setDestinationProperty |
Method Detail |
---|
int getPartCount() throws JMSException
JMSException
- if index is out of bounds.Part getPart(int index) throws JMSException
index
- The 0-based array index of the part requested.
JMSException
- if index is out of bounds.Part getPart(java.lang.String cid) throws JMSException
cid
- The Content-Id of the requested Part
JMSException
- If a part with cid does not existboolean doesPartExist(java.lang.String cid) throws JMSException
cid
- The content-id of the Part
JMSException
- If a part with cid does not existMessage getMessageFromPart(int index) throws JMSException
index
- the index of the part
JMSException
- If the index is out of bounds or if
the part is not a MessagePartMessage getMessageFromPart(java.lang.String cid) throws JMSException
cid
- the content-id of the part
JMSException
- thrown if the part does not exist or
the part is not a MessagePartboolean isMessagePart(int index) throws JMSException
index
- the index of the Part
JMSException
boolean isMessagePart(java.lang.String cid) throws JMSException
cid
- The content-id of the Part
JMSException
void removePart(int index) throws JMSException
index
- the index of the part to remove.
JMSException
- If operation failed due to some internal error.
MessageNotWriteableException
- If message is in read-only mode.void removePart(java.lang.String cid) throws JMSException
cid
- the content-id of the part to remove
JMSException
- If operation failed due to some internal error.
MessageNotWriteableException
- If message is in read-only mode.void addPart(Part part) throws JMSException
part
- The part to be added.
MessageNotWriteableException
- If message is in read-only mode.
JMSException
- If a part with same cid already exists.Part createPart(javax.activation.DataHandler handler) throws JMSException
The Part is not automatically added to the Message.
handler
- the data
JMSException
Part createPart()
The Part is not automatically added to the Message.
Part createPart(java.lang.Object object, java.lang.String type) throws JMSException
The Part is not automatically added to the Message.
object
- The content of the part.type
- The Content-Type associated with the content.
JMSException
- thrown if the type is unsupported or the content
is incompatible with the type specifiedPart createMessagePart(Message message) throws JMSException
The Part is not automatically added to the Message.
message
- The content of the part.
JMSException
- thrown if the type is unsupported or the content
is incompatible with the type specifiedboolean isReadOnly() throws JMSException
JMSException
- If operation failed due to some internal error.void clearReadOnly() throws JMSException
JMSException
- If operation failed due to some internal error.java.lang.String getProfileName() throws JMSException
JMSException
- If operation failed due to some internal error.
|
SonicMQ API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |