|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.petals.component.framework.util.MtomUtil
public final class MtomUtil
Contains utility to manipulate MTOM attachments
| Nested Class Summary | |
|---|---|
static class |
MtomUtil.MtomMapping
A bean that describes a mapping of attachments associated with a Petals message. |
| Field Summary | |
|---|---|
static java.lang.String |
MTOM_NSURI
Include element namespace |
static java.lang.String |
NODE_ATTACHMENTS
Element : "attachments" |
| Constructor Summary | |
|---|---|
MtomUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
compare(java.lang.String attachmentElementValue,
java.lang.String attachmentName)
Compares two strings, the first one being encoded as an URL and not the second. |
static java.lang.String |
convertQNameToString(javax.xml.namespace.QName qname)
Return a string representation of the given QName. |
static org.w3c.dom.Element |
extractAttachmentRootElement(org.w3c.dom.Document inputDocument)
Deprecated. useless method |
static java.util.Set<java.lang.String> |
extractAttachmentsIdFromPayload(org.w3c.dom.Element attachmentRootElement)
In the message payload, extract the identifier(cid) associated with each xop:Include element. |
static org.w3c.dom.DocumentFragment |
generateMtomStructure(org.w3c.dom.Document document,
java.util.List<java.lang.String> contentIds,
javax.xml.namespace.QName element)
Build the xml structure according to xop standard. |
static org.w3c.dom.Node |
generateMtomStructure(org.w3c.dom.Document document,
java.util.List<java.lang.String> contentIds,
javax.xml.namespace.QName rootNode,
javax.xml.namespace.QName customNode)
Build the xml structure according to xop standard. |
static org.w3c.dom.Node |
generateMtomXopElement(org.w3c.dom.Document doc,
java.lang.String contentId)
Generate an Include element according to xop standard. |
static java.util.Map<java.lang.String,javax.activation.DataHandler> |
getAttachments(org.w3c.dom.Document inputDocument,
javax.jbi.messaging.NormalizedMessage nmMessage)
Deprecated. use getMtomMapping(Exchange exchange, Element element) |
static MtomUtil.MtomMapping |
getMtomMapping(org.ow2.petals.component.framework.api.message.Exchange exchange,
org.w3c.dom.Element element)
Builds a MTOM mapping from both an exchange and a root element. |
static java.lang.String |
getNodeName(org.w3c.dom.Node node)
Return the node name |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String MTOM_NSURI
public static final java.lang.String NODE_ATTACHMENTS
| Constructor Detail |
|---|
public MtomUtil()
| Method Detail |
|---|
public static boolean compare(java.lang.String attachmentElementValue,
java.lang.String attachmentName)
This method is used to compare attachment names.
attachmentElementValue - the value of the MTOM attachment, as referenced in the href
attributeattachmentName - the attachment name, as specified in the exchange
java.io.UnsupportedEncodingExceptionpublic static final java.lang.String convertQNameToString(javax.xml.namespace.QName qname)
QName. Name with
prefix is returned if the given QName contains prefix otherwise
return just the localpart.
qname -
@Deprecated
public static org.w3c.dom.Element extractAttachmentRootElement(org.w3c.dom.Document inputDocument)
throws javax.jbi.messaging.MessagingException
inputDocument - Input xml message.
javax.jbi.messaging.MessagingExceptionpublic static java.util.Set<java.lang.String> extractAttachmentsIdFromPayload(org.w3c.dom.Element attachmentRootElement)
inputDocument - Input xml message.exchange -
public static org.w3c.dom.DocumentFragment generateMtomStructure(org.w3c.dom.Document document,
java.util.List<java.lang.String> contentIds,
javax.xml.namespace.QName element)
document - Document used to create node.contentIds - List of attachment id.element - QName representing the element that encapsulate the
xop:Include element.
public static org.w3c.dom.Node generateMtomStructure(org.w3c.dom.Document document,
java.util.List<java.lang.String> contentIds,
javax.xml.namespace.QName rootNode,
javax.xml.namespace.QName customNode)
document - Document used to create node.contentIds - List of attachment id.rootNode - QName representing the root element.customNode - QName representing an additional xml element parent to include
for each xop:Include element
public static org.w3c.dom.Node generateMtomXopElement(org.w3c.dom.Document doc,
java.lang.String contentId)
doc - Document used to create node.contentId - attachment ID
@Deprecated
public static java.util.Map<java.lang.String,javax.activation.DataHandler> getAttachments(org.w3c.dom.Document inputDocument,
javax.jbi.messaging.NormalizedMessage nmMessage)
throws javax.jbi.messaging.MessagingException
inputDocument - exchange -
javax.jbi.messaging.MessagingException
public static MtomUtil.MtomMapping getMtomMapping(org.ow2.petals.component.framework.api.message.Exchange exchange,
org.w3c.dom.Element element)
throws javax.jbi.messaging.MessagingException
exchange - the message exchangeelement - the element from which MTOM elements must be searched.
MTOM elements are elements associated with the name space
http://www.w3.org/2004/08/xop/include.
If null, the root element of the pay-load is taken.
If you already have extracted the pay-load as a document, you
can use Document#getDocumentElement().
MtomUtil.MtomMapping instance otherwise
javax.jbi.messaging.MessagingException - if something went wrong while acquiring the message contentpublic static java.lang.String getNodeName(org.w3c.dom.Node node)
node -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||