public class ScriptMessageContext extends Object implements MessageContext
| Constructor and Description |
|---|
ScriptMessageContext(MessageContext mc,
org.apache.bsf.xml.XMLHelper xmlHelper) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(boolean mustUnderstand,
Object content)
Add a new SOAP header to the message.
|
SynapseConfiguration |
getConfiguration()
Get a reference to the current SynapseConfiguration
|
Map<String,Object> |
getContextEntries()
Return all the entries which are in the MessageContext.
|
Endpoint |
getEndpoint(String key)
Return the endpoint with the given key from the configuration, or the local message
context.
|
Object |
getEntry(String key)
Get the value of a property set on the message instance, from the local registry
or the remote registry - by cascading through
|
org.apache.axiom.soap.SOAPEnvelope |
getEnvelope()
Get the SOAP envelope of this message
|
Object |
getEnvelopeXML()
Get the XML representation of the complete SOAP envelope
|
SynapseEnvironment |
getEnvironment()
Returns a reference to the host Synapse Environment
|
Mediator |
getFaultSequence()
Return the fault sequence from the configuration, or the local message context
This method looks up for the sequence named Constants.FAULT_SEQUENCE_KEY from
the local message context to make this look up transactional - i.e.
|
Stack<FaultHandler> |
getFaultStack() |
org.apache.axis2.addressing.EndpointReference |
getFaultTo()
Get the faultTo EPR if available
|
org.apache.axis2.addressing.EndpointReference |
getFrom()
Get the from EPR if available
|
Object |
getLocalEntry(String key)
Get the value of a property set on the message instance or from the local registry
|
Mediator |
getMainSequence()
Return the main sequence from the configuration, or the local message context
This method looks up for the sequence named Constants.MAIN_SEQUENCE_KEY from
the local message context to make this look up transactional - i.e.
|
String |
getMessageID()
Get the message id if available
|
Object |
getPayloadXML()
Get the XML representation of SOAP Body payload.
|
Object |
getProperty(String key)
Get the value of a custom (local) property set on the message instance
|
Set |
getPropertyKeySet()
Returns the Set of keys over the properties on this message context
|
org.apache.axis2.addressing.RelatesTo |
getRelatesTo()
Get the relatesTo of this message
|
org.apache.axis2.addressing.EndpointReference |
getReplyTo()
Get the replyTo EPR if available
|
Mediator |
getSequence(String key)
Return the sequence with the given key from the configuration, or the local message
context.
|
Mediator |
getSequenceTemplate(String key)
Get the sequence template from the key
|
org.apache.commons.logging.Log |
getServiceLog()
Return the service level Log for this message context or null
|
String |
getSoapAction()
Returns the SOAPAction of the message
|
org.apache.axis2.addressing.EndpointReference |
getTo()
Get the To EPR
|
int |
getTracingState()
This is used to check whether the tracing should be enabled on the current mediator or not
|
String |
getWSAAction()
Returns the WSAAction
|
String |
getWSAMessageID()
Gets the message name
|
boolean |
isDoingGET()
Is this message over GET?
|
boolean |
isDoingMTOM()
If this message using MTOM?
|
boolean |
isDoingPOX()
Is this message over POX?
|
boolean |
isDoingSWA()
If this message using SWA?
|
boolean |
isFaultResponse()
Is this message a response to a fault message?
|
boolean |
isResponse()
Is this message a response to a synchronous message sent out through Synapse?
|
boolean |
isSOAP11()
Is this message a SOAP 1.1 message?
|
void |
pushFaultHandler(FaultHandler fault) |
void |
removeProperty(String key)
Remove property from message context
Scope: Default
|
void |
removeProperty(String key,
String scope)
Remove property from message context
|
void |
setConfiguration(SynapseConfiguration cfg)
Set or replace the Synapse Configuration instance to be used.
|
void |
setContextEntries(Map<String,Object> entries)
Sets the entries to the current context and not to the configuration.
|
void |
setDoingGET(boolean b)
Marks this message as over REST/GET
|
void |
setDoingMTOM(boolean b)
Marks as using MTOM
|
void |
setDoingPOX(boolean b)
Marks this message as over POX
|
void |
setDoingSWA(boolean b)
Marks as using SWA
|
void |
setEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope)
Sets the given envelope as the current SOAPEnvelope for this message
|
void |
setEnvironment(SynapseEnvironment se)
Sets the SynapseEnvironment reference to this context
|
void |
setFaultResponse(boolean b)
Marks this message as a fault response
|
void |
setFaultTo(org.apache.axis2.addressing.EndpointReference reference)
Set the faultTo EPR
|
void |
setFaultTo(String reference) |
void |
setFrom(org.apache.axis2.addressing.EndpointReference reference)
Set the from EPR
|
void |
setFrom(String reference) |
void |
setMessageID(String string)
Set the message id
|
void |
setPayloadXML(Object payload)
Set the SOAP body payload from XML
|
void |
setProperty(String key,
Object value)
Set a custom (local) property with the given name on the message instance
|
void |
setProperty(String key,
Object value,
String scope)
Set Property to the message context
|
void |
setRelatesTo(org.apache.axis2.addressing.RelatesTo[] reference)
Sets the relatesTo references for this message
|
void |
setReplyTo(org.apache.axis2.addressing.EndpointReference reference)
Set the replyTo EPR
|
void |
setReplyTo(String reference) |
void |
setResponse(boolean b)
Mark this message as a response or not.
|
void |
setSoapAction(String string)
Set the SOAPAction
|
void |
setTo(org.apache.axis2.addressing.EndpointReference reference)
Set the To EPR
|
void |
setTo(String reference) |
void |
setTracingState(int tracingState)
This is used to set the value of tracing enable variable
|
void |
setWSAAction(String actionURI)
Sets the WSAAction
|
void |
setWSAMessageID(String messageID)
Set the message
|
public ScriptMessageContext(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 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 SynapseConfiguration getConfiguration()
MessageContextgetConfiguration in interface MessageContextpublic void setConfiguration(SynapseConfiguration cfg)
MessageContextsetConfiguration in interface MessageContextcfg - The new synapse configuration instancepublic SynapseEnvironment getEnvironment()
MessageContextgetEnvironment in interface MessageContextpublic void setEnvironment(SynapseEnvironment se)
MessageContextsetEnvironment in interface MessageContextse - the reference to the Synapse Environmentpublic Map<String,Object> getContextEntries()
MessageContextgetContextEntries in interface MessageContextpublic void setContextEntries(Map<String,Object> entries)
MessageContextsetContextEntries in interface MessageContextentries - the set of local entries to be setpublic Object getProperty(String key)
MessageContextgetProperty in interface MessageContextkey - key to look up propertypublic Object getEntry(String key)
MessageContextgetEntry in interface MessageContextkey - key to look up propertypublic Object getLocalEntry(String key)
MessageContextgetLocalEntry in interface MessageContextkey - key to look up propertypublic void setProperty(String key, Object value)
MessageContextsetProperty in interface MessageContextkey - key to be usedvalue - value to be savedpublic void setProperty(String key, Object value, String scope)
key - property namevalue - property valuescope - scope of the propertypublic void removeProperty(String key)
key - Property namepublic void removeProperty(String key, String scope)
key - Property namescope - Property scopepublic Set getPropertyKeySet()
MessageContextgetPropertyKeySet in interface MessageContextpublic Mediator getMainSequence()
MessageContextgetMainSequence in interface MessageContextpublic Mediator getFaultSequence()
MessageContextgetFaultSequence in interface MessageContextpublic Mediator getSequence(String key)
MessageContextgetSequence in interface MessageContextkey - the sequence key to be looked uppublic Endpoint getEndpoint(String key)
MessageContextgetEndpoint in interface MessageContextkey - the endpoint key to be looked uppublic org.apache.axiom.soap.SOAPEnvelope getEnvelope()
MessageContextgetEnvelope in interface MessageContextpublic void setEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope)
throws org.apache.axis2.AxisFault
MessageContextsetEnvelope in interface MessageContextenvelope - the envelope to be setorg.apache.axis2.AxisFault - on exceptionpublic org.apache.axis2.addressing.EndpointReference getFaultTo()
MessageContextgetFaultTo in interface MessageContextpublic void setFaultTo(org.apache.axis2.addressing.EndpointReference reference)
MessageContextsetFaultTo in interface MessageContextreference - epr representing the FaultTo addresspublic org.apache.axis2.addressing.EndpointReference getFrom()
MessageContextgetFrom in interface MessageContextpublic void setFrom(org.apache.axis2.addressing.EndpointReference reference)
MessageContextsetFrom in interface MessageContextreference - epr representing the From addresspublic String getMessageID()
MessageContextgetMessageID in interface MessageContextpublic void setMessageID(String string)
MessageContextsetMessageID in interface MessageContextstring - message id to be setpublic org.apache.axis2.addressing.RelatesTo getRelatesTo()
MessageContextgetRelatesTo in interface MessageContextpublic void setRelatesTo(org.apache.axis2.addressing.RelatesTo[] reference)
MessageContextsetRelatesTo in interface MessageContextreference - the relatesTo references arraypublic org.apache.axis2.addressing.EndpointReference getReplyTo()
MessageContextgetReplyTo in interface MessageContextpublic void setReplyTo(org.apache.axis2.addressing.EndpointReference reference)
MessageContextsetReplyTo in interface MessageContextreference - epr representing the ReplyTo addresspublic org.apache.axis2.addressing.EndpointReference getTo()
MessageContextgetTo in interface MessageContextpublic void setTo(org.apache.axis2.addressing.EndpointReference reference)
MessageContextsetTo in interface MessageContextreference - the To EPRpublic void setWSAAction(String actionURI)
MessageContextsetWSAAction in interface MessageContextactionURI - the WSAActionpublic String getWSAAction()
MessageContextgetWSAAction in interface MessageContextpublic String getSoapAction()
MessageContextgetSoapAction in interface MessageContextpublic void setSoapAction(String string)
MessageContextsetSoapAction in interface MessageContextstring - the SOAP Actionpublic void setWSAMessageID(String messageID)
MessageContextsetWSAMessageID in interface MessageContextmessageID - message id to be setpublic String getWSAMessageID()
MessageContextgetWSAMessageID in interface MessageContextpublic boolean isDoingMTOM()
MessageContextisDoingMTOM in interface MessageContextpublic boolean isDoingSWA()
MessageContextisDoingSWA in interface MessageContextpublic void setDoingMTOM(boolean b)
MessageContextsetDoingMTOM in interface MessageContextb - true to mark as using MTOMpublic void setDoingSWA(boolean b)
MessageContextsetDoingSWA in interface MessageContextb - true to mark as using SWApublic boolean isDoingPOX()
MessageContextisDoingPOX in interface MessageContextpublic void setDoingPOX(boolean b)
MessageContextsetDoingPOX in interface MessageContextb - true to mark as POXpublic boolean isDoingGET()
MessageContextisDoingGET in interface MessageContextpublic void setDoingGET(boolean b)
MessageContextsetDoingGET in interface MessageContextb - true to mark as REST/GETpublic boolean isSOAP11()
MessageContextisSOAP11 in interface MessageContextpublic void setResponse(boolean b)
MessageContextsetResponse in interface MessageContextb - true to set this as a responseMessageContext.isResponse()public boolean isResponse()
MessageContextisResponse in interface MessageContextpublic void setFaultResponse(boolean b)
MessageContextsetFaultResponse in interface MessageContextb - true to mark this as a fault responseMessageContext.isFaultResponse()public boolean isFaultResponse()
MessageContextisFaultResponse in interface MessageContextpublic int getTracingState()
MessageContextgetTracingState in interface MessageContextpublic void setTracingState(int tracingState)
MessageContextsetTracingState in interface MessageContexttracingState - Set whether the tracing is enabled or notpublic Stack<FaultHandler> getFaultStack()
getFaultStack in interface MessageContextpublic void pushFaultHandler(FaultHandler fault)
pushFaultHandler in interface MessageContextpublic org.apache.commons.logging.Log getServiceLog()
MessageContextgetServiceLog in interface MessageContextpublic Mediator getSequenceTemplate(String key)
getSequenceTemplate in interface MessageContextkey - the sequence key to be looked upCopyright © 2005-2017 Apache Software Foundation. All Rights Reserved.