|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.petals.component.framework.api.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 String |
MTOM_NSURI
Include element namespace |
static String |
NODE_ATTACHMENTS
Element : "attachments" |
| Constructor Summary | |
|---|---|
MtomUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
compare(String attachmentElementValue,
String attachmentName)
Compares two strings, the first one being encoded as an URL and not the second. |
static String |
convertQNameToString(QName qname)
Return a string representation of the given QName. |
static Element |
extractAttachmentRootElement(Document inputDocument)
Deprecated. useless method |
static Set<String> |
extractAttachmentsIdFromPayload(Element attachmentRootElement)
In the message payload, extract the identifier(cid) associated with each xop:Include element. |
static DocumentFragment |
generateMtomStructure(Document document,
List<String> contentIds,
QName element)
Build the xml structure according to xop standard. |
static Node |
generateMtomStructure(Document document,
List<String> contentIds,
QName rootNode,
QName customNode)
Build the xml structure according to xop standard. |
static Node |
generateMtomXopElement(Document doc,
String contentId)
Generate an Include element according to xop standard. |
static Map<String,DataHandler> |
getAttachments(Document inputDocument,
javax.jbi.messaging.NormalizedMessage nmMessage)
Deprecated. use getMtomMapping(Exchange exchange, Element element) |
static MtomUtil.MtomMapping |
getMtomMapping(Exchange exchange,
Element element)
Builds a MTOM mapping from both an exchange and a root element. |
static String |
getNodeName(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 String MTOM_NSURI
public static final String NODE_ATTACHMENTS
| Constructor Detail |
|---|
public MtomUtil()
| Method Detail |
|---|
public static boolean compare(String attachmentElementValue,
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
UnsupportedEncodingExceptionpublic static final String convertQNameToString(QName qname)
QName. Name with
prefix is returned if the given QName contains prefix otherwise
return just the localpart.
qname -
@Deprecated
public static Element extractAttachmentRootElement(Document inputDocument)
throws javax.jbi.messaging.MessagingException
inputDocument - Input xml message.
javax.jbi.messaging.MessagingExceptionpublic static Set<String> extractAttachmentsIdFromPayload(Element attachmentRootElement)
inputDocument - Input xml message.exchange -
public static DocumentFragment generateMtomStructure(Document document,
List<String> contentIds,
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 Node generateMtomStructure(Document document,
List<String> contentIds,
QName rootNode,
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 Node generateMtomXopElement(Document doc,
String contentId)
doc - Document used to create node.contentId - attachment ID
@Deprecated
public static Map<String,DataHandler> getAttachments(Document inputDocument,
javax.jbi.messaging.NormalizedMessage nmMessage)
throws javax.jbi.messaging.MessagingException
inputDocument - exchange -
javax.jbi.messaging.MessagingException
public static MtomUtil.MtomMapping getMtomMapping(Exchange exchange,
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 String getNodeName(Node node)
node -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||