public class EIPUtils
extends java.lang.Object
Constructor and Description |
---|
EIPUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
createSynapseEIPTemplateProperty(MessageContext synCtxt,
java.lang.String templateName,
java.lang.String paramName,
java.lang.Object value) |
static org.apache.axiom.soap.SOAPEnvelope |
encloseWithElement(org.apache.axiom.soap.SOAPEnvelope envelope,
org.apache.axiom.om.OMElement encloseElement)
Enclose children of the soap body with a specific element
|
static void |
enrichEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope,
MessageContext synCtxt,
SynapseXPath expression)
Modifies the envelope based on the provided XPath expression
element that enriches the first envelope from the second
|
static void |
enrichEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope,
org.apache.axiom.soap.SOAPEnvelope enricher,
MessageContext synCtxt,
SynapseXPath expression)
Merge two SOAP envelopes using the given XPath expression that specifies the
element that enriches the first envelope from the second
|
static java.lang.Object |
formatJsonPathResponse(java.lang.Object input)
Formats the response from jsonpath operations
JayWay json-path response have additional elements like "members"(for objects) and "elements"(for arrays)
This method will correct such strings by removing additional elements.
|
static java.util.List<org.apache.axiom.om.OMNode> |
getDetachedMatchingElements(org.apache.axiom.soap.SOAPEnvelope envelope,
MessageContext synCtxt,
SynapseXPath expression)
Return the set of detached elements specified by the XPath over the given envelope
|
static com.google.gson.JsonElement |
getJSONElement(MessageContext messageContext,
SynapseJsonPath jsonPath)
Evaluate JSON path and retrieve the result as JsonElement.
|
static com.google.gson.JsonElement |
getJSONObjectAsElement(MessageContext messageContext,
SynapseJsonPath jsonPath)
Evaluate JSON path and retrieve the result as JsonElement while checking if the evaluated results are
nothing other than JSON objects.
|
static java.util.List |
getMatchingElements(org.apache.axiom.soap.SOAPEnvelope envelope,
MessageContext synCtxt,
SynapseXPath expression)
Return the set of elements specified by the XPath over the given envelope
|
static java.util.List |
getMatchingElements(org.apache.axiom.soap.SOAPEnvelope envelope,
SynapseXPath expression)
Return the set of elements specified by the XPath over the given envelope
|
static java.lang.String |
getTemplatePropertyMapping(java.lang.String templateName,
java.lang.String parameter)
Util functions related to EIP Templates
|
static void |
mergeJsonObjects(com.google.gson.JsonObject primaryPayload,
com.google.gson.JsonObject secondaryPayload)
This merges two json objects into one.
|
static void |
setJsonPathConfiguration()
Set default configuration for Jayway JsonPath by providing the JsonProviders and Mapping providers
|
static com.google.gson.JsonElement |
tryParseJsonString(com.google.gson.JsonParser parser,
java.lang.String inputJson)
Given a json string and a parser this method will return the parsed string.
|
public static java.util.List getMatchingElements(org.apache.axiom.soap.SOAPEnvelope envelope, SynapseXPath expression) throws org.jaxen.JaxenException
envelope
- SOAPEnvelope from which the elements will be extractedexpression
- SynapseXPath expression describing the elements to be extractedorg.jaxen.JaxenException
- if the XPath expression evaluation failspublic static java.util.List getMatchingElements(org.apache.axiom.soap.SOAPEnvelope envelope, MessageContext synCtxt, SynapseXPath expression) throws org.jaxen.JaxenException
envelope
- SOAPEnvelope from which the elements will be extractedexpression
- SynapseXPath expression describing the elements to be extractedorg.jaxen.JaxenException
- if the XPath expression evaluation failspublic static java.util.List<org.apache.axiom.om.OMNode> getDetachedMatchingElements(org.apache.axiom.soap.SOAPEnvelope envelope, MessageContext synCtxt, SynapseXPath expression) throws org.jaxen.JaxenException
envelope
- SOAPEnvelope from which the elements will be extractedexpression
- SynapseXPath expression describing the elements to be extractedorg.jaxen.JaxenException
- if the XPath expression evaluation failspublic static void enrichEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope, MessageContext synCtxt, SynapseXPath expression) throws org.jaxen.JaxenException
envelope
- SOAPEnvelope to be enriched with the contentexpression
- SynapseXPath describing the enriching elementorg.jaxen.JaxenException
- on failing of processing the xpathpublic static void enrichEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope, org.apache.axiom.soap.SOAPEnvelope enricher, MessageContext synCtxt, SynapseXPath expression) throws org.jaxen.JaxenException
envelope
- SOAPEnvelope to be enriched with the contentexpression
- SynapseXPath describing the enriching elementorg.jaxen.JaxenException
- on failing of processing the xpathpublic static java.lang.String getTemplatePropertyMapping(java.lang.String templateName, java.lang.String parameter)
public static void createSynapseEIPTemplateProperty(MessageContext synCtxt, java.lang.String templateName, java.lang.String paramName, java.lang.Object value)
public static org.apache.axiom.soap.SOAPEnvelope encloseWithElement(org.apache.axiom.soap.SOAPEnvelope envelope, org.apache.axiom.om.OMElement encloseElement)
envelope
- SOAPEnvelope which is to be enclosedencloseElement
- enclosing elementpublic static com.google.gson.JsonElement getJSONElement(MessageContext messageContext, SynapseJsonPath jsonPath)
messageContext
- messageContext which contains the JSON payload.public static com.google.gson.JsonElement getJSONObjectAsElement(MessageContext messageContext, SynapseJsonPath jsonPath) throws com.google.gson.JsonParseException, JSONObjectExtensionException
messageContext
- messageContext which contains the JSON payload.com.google.gson.JsonParseException
JSONObjectExtensionException
public static com.google.gson.JsonElement tryParseJsonString(com.google.gson.JsonParser parser, java.lang.String inputJson)
parser
- JSON parser instance.inputJson
- input JSON string.public static java.lang.Object formatJsonPathResponse(java.lang.Object input)
input
- input jsonElement.public static void mergeJsonObjects(com.google.gson.JsonObject primaryPayload, com.google.gson.JsonObject secondaryPayload)
primaryPayload
- The json object where the key value pairs will be addedsecondaryPayload
- The json object whose key value pair will be added to primaryPayloadpublic static void setJsonPathConfiguration()
Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.