public class CommonScriptMessageContext extends java.lang.Object implements ScriptMessageContext
Constructor and Description |
---|
CommonScriptMessageContext(org.apache.synapse.MessageContext mc,
org.apache.bsf.xml.XMLHelper xmlHelper) |
Modifier and Type | Method and Description |
---|---|
void |
addHeader(boolean mustUnderstand,
java.lang.Object content)
Add a new SOAP header to the message.
|
org.apache.synapse.config.SynapseConfiguration |
getConfiguration() |
java.util.Map<java.lang.String,java.lang.Object> |
getContextEntries() |
java.util.Stack<org.apache.synapse.ContinuationState> |
getContinuationStateStack() |
org.apache.synapse.Mediator |
getDefaultConfiguration(java.lang.String arg0) |
org.apache.synapse.endpoints.Endpoint |
getEndpoint(java.lang.String key) |
java.lang.Object |
getEntry(java.lang.String key) |
org.apache.axiom.soap.SOAPEnvelope |
getEnvelope() |
java.lang.Object |
getEnvelopeXML()
Get the XML representation of the complete SOAP envelope.
|
org.apache.synapse.core.SynapseEnvironment |
getEnvironment() |
org.apache.synapse.Mediator |
getFaultSequence() |
java.util.Stack<org.apache.synapse.FaultHandler> |
getFaultStack() |
org.apache.axis2.addressing.EndpointReference |
getFaultTo() |
org.apache.axiom.om.OMElement |
getFormat(java.lang.String s) |
org.apache.axis2.addressing.EndpointReference |
getFrom() |
java.lang.Object |
getJsonText()
Get the Message Payload as a text.
|
java.lang.Object |
getLocalEntry(java.lang.String key) |
org.apache.synapse.Mediator |
getMainSequence() |
int |
getMessageFlowTracingState() |
java.lang.String |
getMessageID() |
java.lang.String |
getMessageString() |
java.lang.Object |
getPayloadJSON()
Get the JSON object representation of the JSON message body of the request.
|
java.lang.String |
getPayloadText()
Get the Message Payload as a text.
|
java.lang.Object |
getPayloadXML()
Get the XML representation of SOAP Body payload.
|
java.lang.Object |
getProperty(java.lang.String key) |
java.util.Set |
getPropertyKeySet() |
org.apache.axis2.addressing.RelatesTo |
getRelatesTo() |
org.apache.axis2.addressing.EndpointReference |
getReplyTo() |
org.apache.synapse.Mediator |
getSequence(java.lang.String key) |
org.apache.synapse.Mediator |
getSequenceTemplate(java.lang.String key) |
org.apache.commons.logging.Log |
getServiceLog() |
java.lang.String |
getSoapAction() |
org.apache.axis2.addressing.EndpointReference |
getTo() |
int |
getTracingState() |
java.lang.String |
getWSAAction() |
java.lang.String |
getWSAMessageID() |
boolean |
isContinuationEnabled() |
boolean |
isDoingGET() |
boolean |
isDoingMTOM() |
boolean |
isDoingPOX() |
boolean |
isDoingSWA() |
boolean |
isFaultResponse() |
boolean |
isResponse() |
boolean |
isSOAP11() |
java.lang.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(java.lang.String key,
java.lang.String scope)
Remove property from the message.
|
void |
setConfiguration(org.apache.synapse.config.SynapseConfiguration cfg) |
void |
setContextEntries(java.util.Map<java.lang.String,java.lang.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(java.lang.String reference)
This is used to set the value which specifies the receiver of the faults relating to the message.
|
void |
setFrom(org.apache.axis2.addressing.EndpointReference reference) |
void |
setFrom(java.lang.String reference)
This is used to set the value which specifies the sender of the message.
|
boolean |
setJsonObject(org.apache.synapse.MessageContext messageContext,
java.lang.Object jsonObject)
Saves the JavaScript Object to the message context.
|
boolean |
setJsonText(org.apache.synapse.MessageContext messageContext,
java.lang.Object jsonObject)
Saves the JSON String to the message context.
|
void |
setMessageFlowTracingState(int state) |
void |
setMessageID(java.lang.String string) |
void |
setPayloadJSON(java.lang.Object jsonPayload)
Saves the payload of this message context as a JSON payload.
|
void |
setPayloadJSON0(java.lang.Object jsonPayload)
Saves the payload of this message context as a JSON payload.
|
void |
setPayloadXML(java.lang.Object payload)
Set the SOAP body payload from XML.
|
void |
setProperty(java.lang.String key,
java.lang.Object value)
Add a new property to the message.
|
void |
setProperty(java.lang.String key,
java.lang.Object value,
java.lang.String scope)
Add a new property to the message.
|
void |
setRelatesTo(org.apache.axis2.addressing.RelatesTo[] reference) |
void |
setReplyTo(org.apache.axis2.addressing.EndpointReference reference) |
void |
setReplyTo(java.lang.String reference)
This is used to set the value which specifies the receiver of the replies to the message.
|
void |
setResponse(boolean b) |
void |
setScriptEngine(javax.script.ScriptEngine scriptEngine)
Set a script engine.
|
void |
setSoapAction(java.lang.String string) |
void |
setTo(org.apache.axis2.addressing.EndpointReference reference) |
void |
setTo(java.lang.String reference)
This is used to set the value which specifies the receiver of the message.
|
void |
setTracingState(int tracingState) |
void |
setWSAAction(java.lang.String actionURI) |
void |
setWSAMessageID(java.lang.String messageID) |
public CommonScriptMessageContext(org.apache.synapse.MessageContext mc, org.apache.bsf.xml.XMLHelper xmlHelper)
public java.lang.Object getPayloadXML() throws javax.script.ScriptException
getPayloadXML
in interface ScriptMessageContext
javax.script.ScriptException
- in-case of an error in getting
the XML representation of SOAP Body payloadpublic void setPayloadXML(java.lang.Object payload) throws org.apache.axiom.om.OMException, javax.script.ScriptException
setPayloadXML
in interface ScriptMessageContext
payload
- Message payloadjavax.script.ScriptException
- For errors in converting xml To OMorg.apache.axiom.om.OMException
- For errors in OM manipulationpublic java.lang.Object getPayloadJSON()
getPayloadJSON
in interface ScriptMessageContext
public java.lang.Object getJsonText()
getJsonText
in interface ScriptMessageContext
public java.lang.String getPayloadText()
getPayloadText
in interface ScriptMessageContext
public void setPayloadJSON0(java.lang.Object jsonPayload) throws javax.script.ScriptException
jsonPayload
- Javascript native object to be set as the message bodyjavax.script.ScriptException
- in case of creating a JSON object out of
the javascript native object.public boolean setJsonObject(org.apache.synapse.MessageContext messageContext, java.lang.Object jsonObject)
setJsonObject
in interface ScriptMessageContext
messageContext
- The message context of the sequencejsonObject
- JavaScript Object saved in this message contextpublic boolean setJsonText(org.apache.synapse.MessageContext messageContext, java.lang.Object jsonObject)
setJsonText
in interface ScriptMessageContext
messageContext
- The message context of the sequencejsonObject
- JavaScript Object saved in this message contextpublic java.lang.Object jsonObject(org.apache.synapse.MessageContext messageContext)
jsonObject
in interface ScriptMessageContext
messageContext
- The message context of the sequencepublic void setScriptEngine(javax.script.ScriptEngine scriptEngine)
setScriptEngine
in interface ScriptMessageContext
scriptEngine
- a ScriptEngine instancepublic void addHeader(boolean mustUnderstand, java.lang.Object content) throws javax.script.ScriptException
addHeader
in interface ScriptMessageContext
mustUnderstand
- the value for the soapenv:mustUnderstand
attributecontent
- the XML for the new headerjavax.script.ScriptException
- if an error occurs when converting the XML to OMpublic java.lang.Object getEnvelopeXML() throws javax.script.ScriptException
getEnvelopeXML
in interface ScriptMessageContext
javax.script.ScriptException
- in-case of an error in getting
the XML representation of SOAP envelopepublic void setTo(java.lang.String reference)
setTo
in interface ScriptMessageContext
reference
- specifies the receiver of the messagepublic void setFaultTo(java.lang.String reference)
setFaultTo
in interface ScriptMessageContext
reference
- specifies the receiver of the faults relating to the messagepublic void setFrom(java.lang.String reference)
setFrom
in interface ScriptMessageContext
reference
- specifies the sender of the messagepublic void setReplyTo(java.lang.String reference)
setReplyTo
in interface ScriptMessageContext
reference
- specifies the receiver of the replies to the messagepublic 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 java.util.Map<java.lang.String,java.lang.Object> getContextEntries()
getContextEntries
in interface org.apache.synapse.MessageContext
public void setContextEntries(java.util.Map<java.lang.String,java.lang.Object> entries)
setContextEntries
in interface org.apache.synapse.MessageContext
public java.lang.Object getProperty(java.lang.String key)
getProperty
in interface org.apache.synapse.MessageContext
public java.lang.Object getEntry(java.lang.String key)
getEntry
in interface org.apache.synapse.MessageContext
public java.lang.Object getLocalEntry(java.lang.String key)
getLocalEntry
in interface org.apache.synapse.MessageContext
public void setProperty(java.lang.String key, java.lang.Object value)
setProperty
in interface org.apache.synapse.MessageContext
key
- unique identifier of propertyvalue
- value of propertypublic void setProperty(java.lang.String key, java.lang.Object value, java.lang.String scope)
setProperty
in interface ScriptMessageContext
key
- unique identifier of propertyvalue
- value of propertyscope
- scope of the propertypublic void removeProperty(java.lang.String key, java.lang.String scope)
removeProperty
in interface ScriptMessageContext
key
- unique identifier of propertyscope
- scope of the propertypublic java.util.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(java.lang.String key)
getSequence
in interface org.apache.synapse.MessageContext
public org.apache.axiom.om.OMElement getFormat(java.lang.String s)
getFormat
in interface org.apache.synapse.MessageContext
public org.apache.synapse.endpoints.Endpoint getEndpoint(java.lang.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 java.lang.String getMessageID()
getMessageID
in interface org.apache.synapse.MessageContext
public void setMessageID(java.lang.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(java.lang.String actionURI)
setWSAAction
in interface org.apache.synapse.MessageContext
public java.lang.String getWSAAction()
getWSAAction
in interface org.apache.synapse.MessageContext
public java.lang.String getSoapAction()
getSoapAction
in interface org.apache.synapse.MessageContext
public void setSoapAction(java.lang.String string)
setSoapAction
in interface org.apache.synapse.MessageContext
public void setWSAMessageID(java.lang.String messageID)
setWSAMessageID
in interface org.apache.synapse.MessageContext
public java.lang.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 java.util.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 java.util.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(java.lang.String key)
getSequenceTemplate
in interface org.apache.synapse.MessageContext
public void setPayloadJSON(java.lang.Object jsonPayload) throws javax.script.ScriptException
setPayloadJSON
in interface ScriptMessageContext
jsonPayload
- Javascript native object to be set as the message bodyjavax.script.ScriptException
- in case of creating a JSON object out of the javascript native object.public org.apache.synapse.Mediator getDefaultConfiguration(java.lang.String arg0)
getDefaultConfiguration
in interface org.apache.synapse.MessageContext
public java.lang.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-2021 Apache Software Foundation. All Rights Reserved.