Package io.gravitee.gateway.api.context
Class SimpleExecutionContext
- java.lang.Object
-
- io.gravitee.gateway.api.context.SimpleExecutionContext
-
- All Implemented Interfaces:
MutableExecutionContext,ExecutionContext
public class SimpleExecutionContext extends Object implements MutableExecutionContext
- Author:
- David BRASSELY (david.brassely at graviteesource.com), GraviteeSource Team
-
-
Field Summary
-
Fields inherited from interface io.gravitee.gateway.api.ExecutionContext
ATTR_API, ATTR_API_DEPLOYED_AT, ATTR_APPLICATION, ATTR_CONTEXT_PATH, ATTR_ENVIRONMENT, ATTR_FAILURE_ATTRIBUTE, ATTR_INVOKER, ATTR_ORGANIZATION, ATTR_PLAN, ATTR_PREFIX, ATTR_QUOTA_COUNT, ATTR_QUOTA_LIMIT, ATTR_QUOTA_REMAINING, ATTR_QUOTA_RESET_TIME, ATTR_REQUEST_ENDPOINT, ATTR_REQUEST_METHOD, ATTR_RESOLVED_PATH, ATTR_SUBSCRIPTION_ID, ATTR_USER, ATTR_USER_ROLES
-
-
Constructor Summary
Constructors Constructor Description SimpleExecutionContext(Request request, Response response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String name)Returns the value of the named attribute as an Object, ornullif no attribute of the given name exists.Enumeration<String>getAttributeNames()Returns an Enumeration containing the names of the attributes available to this request.Map<String,Object>getAttributes()<T> TgetComponent(Class<T> componentClass)io.gravitee.el.TemplateEnginegetTemplateEngine()io.gravitee.tracing.api.TracergetTracer()voidremoveAttribute(String name)Removes an attribute from this request.Requestrequest()MutableExecutionContextrequest(Request request)Responseresponse()MutableExecutionContextresponse(Response response)voidsetAttribute(String name, Object value)Stores an attribute in this request.
-
-
-
Method Detail
-
request
public MutableExecutionContext request(Request request)
- Specified by:
requestin interfaceMutableExecutionContext
-
response
public MutableExecutionContext response(Response response)
- Specified by:
responsein interfaceMutableExecutionContext
-
request
public Request request()
- Specified by:
requestin interfaceExecutionContext
-
response
public Response response()
- Specified by:
responsein interfaceExecutionContext
-
getComponent
public <T> T getComponent(Class<T> componentClass)
- Specified by:
getComponentin interfaceExecutionContext
-
setAttribute
public void setAttribute(String name, Object value)
Description copied from interface:ExecutionContextStores an attribute in this request. Attributes are reset between requests.- Specified by:
setAttributein interfaceExecutionContext- Parameters:
name- a String specifying the name of the attributevalue- the Object to be stored
-
removeAttribute
public void removeAttribute(String name)
Description copied from interface:ExecutionContextRemoves an attribute from this request. This method is not generally needed as attributes only persist as long as the request is being handled.- Specified by:
removeAttributein interfaceExecutionContext- Parameters:
name- a String specifying the name of the attribute to remove
-
getAttribute
public Object getAttribute(String name)
Description copied from interface:ExecutionContextReturns the value of the named attribute as an Object, ornullif no attribute of the given name exists.- Specified by:
getAttributein interfaceExecutionContext- Parameters:
name- a String specifying the name of the attribute- Returns:
- an Object containing the value of the attribute, or null if the attribute does not exist
-
getAttributeNames
public Enumeration<String> getAttributeNames()
Description copied from interface:ExecutionContextReturns an Enumeration containing the names of the attributes available to this request. This method returns an empty Enumeration if the request has no attributes available to it.- Specified by:
getAttributeNamesin interfaceExecutionContext- Returns:
- an Enumeration of strings containing the names of the request's attributes
-
getTemplateEngine
public io.gravitee.el.TemplateEngine getTemplateEngine()
- Specified by:
getTemplateEnginein interfaceExecutionContext
-
getTracer
public io.gravitee.tracing.api.Tracer getTracer()
- Specified by:
getTracerin interfaceExecutionContext
-
getAttributes
public Map<String,Object> getAttributes()
- Specified by:
getAttributesin interfaceExecutionContext
-
-