Class EvaluatorContext
- java.lang.Object
-
- org.apache.synapse.commons.evaluators.EvaluatorContext
-
public class EvaluatorContext extends Object
Holds the information about the HTTP request. Created on per request basis and passed to each and every evaluator.
-
-
Constructor Summary
Constructors Constructor Description EvaluatorContext(String url, Map<String,String> headers)
Creates the Evalutor context with the URL and the set of HTTP headers
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getHeader(String name)
Get the HTTP header value for the Header nameMap<String,String>
getHeaders()
Get all the HTTP headersorg.apache.axis2.context.MessageContext
getMessageContext()
Get the message context associated with this evaluator contextString
getParam(String name)
Return the value of a HTTP parameterMap<String,String>
getParams()
Get all the HTTP parametersObject
getProperty(String name)
Get the value of the named propertyString
getUrl()
Get the complete URLvoid
setHeaders(Map<String,String> headers)
Set the headersvoid
setMessageContext(org.apache.axis2.context.MessageContext messageContext)
Set the current Axis2 MessageContext to this evaluator contextvoid
setParams(Map<String,String> params)
Set all the HTTP URL parametersvoid
setProperties(Map<String,Object> properties)
Associate a set of properties with this evaluator contextvoid
setUrl(String url)
Set the URL
-
-
-
Method Detail
-
getUrl
public String getUrl()
Get the complete URL- Returns:
- URL
-
getHeaders
public Map<String,String> getHeaders()
Get all the HTTP headers- Returns:
- all the HTTP headers as name value pairs
-
getParams
public Map<String,String> getParams()
Get all the HTTP parameters- Returns:
- all the HTTP parameter as Name Value pairs
-
getParam
public String getParam(String name) throws UnsupportedEncodingException
Return the value of a HTTP parameter- Parameters:
name
- name of the parameter- Returns:
- value of the parameter
- Throws:
UnsupportedEncodingException
- if cannot decode the URLs
-
getHeader
public String getHeader(String name)
Get the HTTP header value for the Header name- Parameters:
name
- name of the header- Returns:
- header value
-
getMessageContext
public org.apache.axis2.context.MessageContext getMessageContext()
Get the message context associated with this evaluator context- Returns:
- an Axis2 MessageContext instance or null
-
getProperty
public Object getProperty(String name)
Get the value of the named property- Parameters:
name
- Name of the property- Returns:
- A string property value or null
-
setUrl
public void setUrl(String url)
Set the URL- Parameters:
url
- to be set
-
setHeaders
public void setHeaders(Map<String,String> headers)
Set the headers- Parameters:
headers
- as a HeaderName, HeaderValue pair map
-
setParams
public void setParams(Map<String,String> params)
Set all the HTTP URL parameters- Parameters:
params
- as a ParameterName, ParameterValue pair map
-
setMessageContext
public void setMessageContext(org.apache.axis2.context.MessageContext messageContext)
Set the current Axis2 MessageContext to this evaluator context- Parameters:
messageContext
- an Axis2 MessageContext object
-
-