Class EvaluatorContext
java.lang.Object
org.apache.synapse.commons.evaluators.EvaluatorContext
Holds the information about the HTTP request. Created on per request basis and
passed to each and every evaluator.
-
Constructor Summary
ConstructorsConstructorDescriptionEvaluatorContext(String url, Map<String, String> headers) Creates the Evalutor context with the URL and the set of HTTP headers -
Method Summary
Modifier and TypeMethodDescriptionGet the HTTP header value for the Header nameGet all the HTTP headersorg.apache.axis2.context.MessageContextGet the message context associated with this evaluator contextReturn the value of a HTTP parameterGet all the HTTP parametersgetProperty(String name) Get the value of the named propertygetUrl()Get the complete URLvoidsetHeaders(Map<String, String> headers) Set the headersvoidsetMessageContext(org.apache.axis2.context.MessageContext messageContext) Set the current Axis2 MessageContext to this evaluator contextvoidSet all the HTTP URL parametersvoidsetProperties(Map<String, Object> properties) Associate a set of properties with this evaluator contextvoidSet the URL
-
Constructor Details
-
EvaluatorContext
Creates the Evalutor context with the URL and the set of HTTP headers- Parameters:
url- urlheaders- HTTP header as a Name, Value map
-
-
Method Details
-
getUrl
Get the complete URL- Returns:
- URL
-
getHeaders
Get all the HTTP headers- Returns:
- all the HTTP headers as name value pairs
-
getParams
Get all the HTTP parameters- Returns:
- all the HTTP parameter as Name Value pairs
-
getParam
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
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
Get the value of the named property- Parameters:
name- Name of the property- Returns:
- A string property value or null
-
setUrl
Set the URL- Parameters:
url- to be set
-
setHeaders
Set the headers- Parameters:
headers- as a HeaderName, HeaderValue pair map
-
setParams
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
-
setProperties
Associate a set of properties with this evaluator context- Parameters:
properties- a Properties map
-