public class ScriptMessageContext extends Object implements org.apache.synapse.MessageContext
Constructor and Description |
---|
ScriptMessageContext(org.apache.synapse.MessageContext mc,
org.apache.bsf.xml.XMLHelper xmlHelper) |
Modifier and Type | Method and Description |
---|---|
void |
addComponentToMessageFlow(String mediatorId) |
void |
addHeader(boolean mustUnderstand,
Object content)
Add a new SOAP header to the message.
|
org.apache.synapse.config.SynapseConfiguration |
getConfiguration() |
Map<String,Object> |
getContextEntries() |
Stack<org.apache.synapse.ContinuationState> |
getContinuationStateStack() |
org.apache.synapse.Mediator |
getDefaultConfiguration(String arg0) |
org.apache.synapse.endpoints.Endpoint |
getEndpoint(String key) |
Object |
getEntry(String key) |
org.apache.axiom.soap.SOAPEnvelope |
getEnvelope() |
Object |
getEnvelopeXML()
Get the XML representation of the complete SOAP envelope
|
org.apache.synapse.core.SynapseEnvironment |
getEnvironment() |
org.apache.synapse.Mediator |
getFaultSequence() |
Stack<org.apache.synapse.FaultHandler> |
getFaultStack() |
org.apache.axis2.addressing.EndpointReference |
getFaultTo() |
org.apache.axiom.om.OMElement |
getFormat(String s) |
org.apache.axis2.addressing.EndpointReference |
getFrom() |
Object |
getJsonText() |
Object |
getLocalEntry(String key) |
org.apache.synapse.Mediator |
getMainSequence() |
int |
getMessageFlowTracingState() |
String |
getMessageID() |
String |
getMessageString() |
Object |
getPayloadJSON()
Get the JSON object representation of the JSON message body of the request.
|
String |
getPayloadText()
Get the Message Payload as a text
|
Object |
getPayloadXML()
Get the XML representation of SOAP Body payload.
|
Object |
getProperty(String key) |
Set |
getPropertyKeySet() |
org.apache.axis2.addressing.RelatesTo |
getRelatesTo() |
org.apache.axis2.addressing.EndpointReference |
getReplyTo() |
org.apache.synapse.Mediator |
getSequence(String key) |
org.apache.synapse.Mediator |
getSequenceTemplate(String key) |
org.apache.commons.logging.Log |
getServiceLog() |
String |
getSoapAction() |
org.apache.axis2.addressing.EndpointReference |
getTo() |
int |
getTracingState() |
String |
getWSAAction() |
String |
getWSAMessageID() |
boolean |
isContinuationEnabled() |
boolean |
isDoingGET() |
boolean |
isDoingMTOM() |
boolean |
isDoingPOX() |
boolean |
isDoingSWA() |
boolean |
isFaultResponse() |
boolean |
isResponse() |
boolean |
isSOAP11() |
Object |
jsonObject(org.apache.synapse.MessageContext messageContext)
Returns the JavaScript Object saved in this message context.
|
void |
pushContinuationState(org.apache.synapse.ContinuationState continuationState) |
void |
pushFaultHandler(org.apache.synapse.FaultHandler fault) |
void |
removeProperty(String key,
String scope) |
void |
setConfiguration(org.apache.synapse.config.SynapseConfiguration cfg) |
void |
setContextEntries(Map<String,Object> entries) |
void |
setContinuationEnabled(boolean contStateStackEnabled) |
void |
setDoingGET(boolean b) |
void |
setDoingMTOM(boolean b) |
void |
setDoingPOX(boolean b) |
void |
setDoingSWA(boolean b) |
void |
setEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope) |
void |
setEnvironment(org.apache.synapse.core.SynapseEnvironment se) |
void |
setFaultResponse(boolean b) |
void |
setFaultTo(org.apache.axis2.addressing.EndpointReference reference) |
void |
setFaultTo(String reference) |
void |
setFrom(org.apache.axis2.addressing.EndpointReference reference) |
void |
setFrom(String reference) |
boolean |
setJsonObject(org.apache.synapse.MessageContext messageContext,
Object jsonObject)
Saves the JavaScript Object to the message context.
|
boolean |
setJsonText(org.apache.synapse.MessageContext messageContext,
Object jsonObject)
Saves the JSON String to the message context.
|
void |
setMessageFlowTracingState(int state) |
void |
setMessageID(String string) |
void |
setPayloadJSON(Object jsonPayload) |
void |
setPayloadJSON0(Object jsonPayload)
/**
Saves the payload of this message context as a JSON payload.
|
void |
setPayloadXML(Object payload)
Set the SOAP body payload from XML
|
void |
setProperty(String key,
Object value) |
void |
setProperty(String key,
Object value,
String scope) |
void |
setRelatesTo(org.apache.axis2.addressing.RelatesTo[] reference) |
void |
setReplyTo(org.apache.axis2.addressing.EndpointReference reference) |
void |
setReplyTo(String reference) |
void |
setResponse(boolean b) |
void |
setScriptEngine(ScriptEngine scriptEngine)
Set a script engine
|
void |
setSoapAction(String string) |
void |
setTo(org.apache.axis2.addressing.EndpointReference reference) |
void |
setTo(String reference) |
void |
setTracingState(int tracingState) |
void |
setWSAAction(String actionURI) |
void |
setWSAMessageID(String messageID) |
public ScriptMessageContext(org.apache.synapse.MessageContext mc, org.apache.bsf.xml.XMLHelper xmlHelper)
public Object getPayloadXML() throws ScriptException
ScriptException
- in-case of an error in getting
the XML representation of SOAP Body payloadpublic void setPayloadXML(Object payload) throws org.apache.axiom.om.OMException, ScriptException
payload
- Message payloadScriptException
- For errors in converting xml To OMorg.apache.axiom.om.OMException
- For errors in OM manipulationpublic Object getPayloadJSON()
public Object getJsonText()
public String getPayloadText()
public void setPayloadJSON0(Object jsonPayload) throws ScriptException
jsonPayload
- Javascript native object to be set as the message bodyScriptException
- in case of creating a JSON object out of
the javascript native object.public boolean setJsonObject(org.apache.synapse.MessageContext messageContext, Object jsonObject)
messageContext
- jsonObject
- public boolean setJsonText(org.apache.synapse.MessageContext messageContext, Object jsonObject)
messageContext
- jsonObject
- public Object jsonObject(org.apache.synapse.MessageContext messageContext)
messageContext
- public void setScriptEngine(ScriptEngine scriptEngine)
scriptEngine
- a ScriptEngine instancepublic void addHeader(boolean mustUnderstand, Object content) throws ScriptException
mustUnderstand
- the value for the soapenv:mustUnderstand
attributecontent
- the XML for the new headerScriptException
- if an error occurs when converting the XML to OMpublic Object getEnvelopeXML() throws ScriptException
ScriptException
- in-case of an error in getting
the XML representation of SOAP envelopepublic void setTo(String reference)
public void setFaultTo(String reference)
public void setFrom(String reference)
public void setReplyTo(String reference)
public org.apache.synapse.config.SynapseConfiguration getConfiguration()
getConfiguration
in interface org.apache.synapse.MessageContext
public void setConfiguration(org.apache.synapse.config.SynapseConfiguration cfg)
setConfiguration
in interface org.apache.synapse.MessageContext
public org.apache.synapse.core.SynapseEnvironment getEnvironment()
getEnvironment
in interface org.apache.synapse.MessageContext
public void setEnvironment(org.apache.synapse.core.SynapseEnvironment se)
setEnvironment
in interface org.apache.synapse.MessageContext
public Map<String,Object> getContextEntries()
getContextEntries
in interface org.apache.synapse.MessageContext
public void setContextEntries(Map<String,Object> entries)
setContextEntries
in interface org.apache.synapse.MessageContext
public Object getProperty(String key)
getProperty
in interface org.apache.synapse.MessageContext
public Object getEntry(String key)
getEntry
in interface org.apache.synapse.MessageContext
public Object getLocalEntry(String key)
getLocalEntry
in interface org.apache.synapse.MessageContext
public void setProperty(String key, Object value)
setProperty
in interface org.apache.synapse.MessageContext
public Set getPropertyKeySet()
getPropertyKeySet
in interface org.apache.synapse.MessageContext
public org.apache.synapse.Mediator getMainSequence()
getMainSequence
in interface org.apache.synapse.MessageContext
public org.apache.synapse.Mediator getFaultSequence()
getFaultSequence
in interface org.apache.synapse.MessageContext
public org.apache.synapse.Mediator getSequence(String key)
getSequence
in interface org.apache.synapse.MessageContext
public org.apache.axiom.om.OMElement getFormat(String s)
getFormat
in interface org.apache.synapse.MessageContext
public org.apache.synapse.endpoints.Endpoint getEndpoint(String key)
getEndpoint
in interface org.apache.synapse.MessageContext
public org.apache.axiom.soap.SOAPEnvelope getEnvelope()
getEnvelope
in interface org.apache.synapse.MessageContext
public void setEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope) throws org.apache.axis2.AxisFault
setEnvelope
in interface org.apache.synapse.MessageContext
org.apache.axis2.AxisFault
public org.apache.axis2.addressing.EndpointReference getFaultTo()
getFaultTo
in interface org.apache.synapse.MessageContext
public void setFaultTo(org.apache.axis2.addressing.EndpointReference reference)
setFaultTo
in interface org.apache.synapse.MessageContext
public org.apache.axis2.addressing.EndpointReference getFrom()
getFrom
in interface org.apache.synapse.MessageContext
public void setFrom(org.apache.axis2.addressing.EndpointReference reference)
setFrom
in interface org.apache.synapse.MessageContext
public String getMessageID()
getMessageID
in interface org.apache.synapse.MessageContext
public void setMessageID(String string)
setMessageID
in interface org.apache.synapse.MessageContext
public org.apache.axis2.addressing.RelatesTo getRelatesTo()
getRelatesTo
in interface org.apache.synapse.MessageContext
public void setRelatesTo(org.apache.axis2.addressing.RelatesTo[] reference)
setRelatesTo
in interface org.apache.synapse.MessageContext
public org.apache.axis2.addressing.EndpointReference getReplyTo()
getReplyTo
in interface org.apache.synapse.MessageContext
public void setReplyTo(org.apache.axis2.addressing.EndpointReference reference)
setReplyTo
in interface org.apache.synapse.MessageContext
public org.apache.axis2.addressing.EndpointReference getTo()
getTo
in interface org.apache.synapse.MessageContext
public void setTo(org.apache.axis2.addressing.EndpointReference reference)
setTo
in interface org.apache.synapse.MessageContext
public void setWSAAction(String actionURI)
setWSAAction
in interface org.apache.synapse.MessageContext
public String getWSAAction()
getWSAAction
in interface org.apache.synapse.MessageContext
public String getSoapAction()
getSoapAction
in interface org.apache.synapse.MessageContext
public void setSoapAction(String string)
setSoapAction
in interface org.apache.synapse.MessageContext
public void setWSAMessageID(String messageID)
setWSAMessageID
in interface org.apache.synapse.MessageContext
public String getWSAMessageID()
getWSAMessageID
in interface org.apache.synapse.MessageContext
public boolean isDoingMTOM()
isDoingMTOM
in interface org.apache.synapse.MessageContext
public boolean isDoingSWA()
isDoingSWA
in interface org.apache.synapse.MessageContext
public void setDoingMTOM(boolean b)
setDoingMTOM
in interface org.apache.synapse.MessageContext
public void setDoingSWA(boolean b)
setDoingSWA
in interface org.apache.synapse.MessageContext
public boolean isDoingPOX()
isDoingPOX
in interface org.apache.synapse.MessageContext
public void setDoingPOX(boolean b)
setDoingPOX
in interface org.apache.synapse.MessageContext
public boolean isDoingGET()
isDoingGET
in interface org.apache.synapse.MessageContext
public void setDoingGET(boolean b)
setDoingGET
in interface org.apache.synapse.MessageContext
public boolean isSOAP11()
isSOAP11
in interface org.apache.synapse.MessageContext
public void setResponse(boolean b)
setResponse
in interface org.apache.synapse.MessageContext
public boolean isResponse()
isResponse
in interface org.apache.synapse.MessageContext
public void setFaultResponse(boolean b)
setFaultResponse
in interface org.apache.synapse.MessageContext
public boolean isFaultResponse()
isFaultResponse
in interface org.apache.synapse.MessageContext
public int getTracingState()
getTracingState
in interface org.apache.synapse.MessageContext
public void setTracingState(int tracingState)
setTracingState
in interface org.apache.synapse.MessageContext
public Stack<org.apache.synapse.FaultHandler> getFaultStack()
getFaultStack
in interface org.apache.synapse.MessageContext
public void pushFaultHandler(org.apache.synapse.FaultHandler fault)
pushFaultHandler
in interface org.apache.synapse.MessageContext
public void pushContinuationState(org.apache.synapse.ContinuationState continuationState)
pushContinuationState
in interface org.apache.synapse.MessageContext
public Stack<org.apache.synapse.ContinuationState> getContinuationStateStack()
getContinuationStateStack
in interface org.apache.synapse.MessageContext
public boolean isContinuationEnabled()
isContinuationEnabled
in interface org.apache.synapse.MessageContext
public void setContinuationEnabled(boolean contStateStackEnabled)
setContinuationEnabled
in interface org.apache.synapse.MessageContext
public org.apache.commons.logging.Log getServiceLog()
getServiceLog
in interface org.apache.synapse.MessageContext
public org.apache.synapse.Mediator getSequenceTemplate(String key)
getSequenceTemplate
in interface org.apache.synapse.MessageContext
public void setPayloadJSON(Object jsonPayload) throws ScriptException
ScriptException
public org.apache.synapse.Mediator getDefaultConfiguration(String arg0)
getDefaultConfiguration
in interface org.apache.synapse.MessageContext
public void addComponentToMessageFlow(String mediatorId)
public String getMessageString()
getMessageString
in interface org.apache.synapse.MessageContext
public void setMessageFlowTracingState(int state)
setMessageFlowTracingState
in interface org.apache.synapse.MessageContext
public int getMessageFlowTracingState()
getMessageFlowTracingState
in interface org.apache.synapse.MessageContext
Copyright © 2005–2017 Apache Software Foundation. All rights reserved.