Package org.apache.olingo.odata2.core
Class ODataContextImpl
java.lang.Object
org.apache.olingo.odata2.core.ODataContextImpl
- All Implemented Interfaces:
ODataContext
Context.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.olingo.odata2.api.processor.ODataContext
ODataContext.RuntimeMeasurement -
Field Summary
Fields inherited from interface org.apache.olingo.odata2.api.processor.ODataContext
HTTP_SERVLET_REQUEST_OBJECT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a list of languages that are acceptable for the response.If a request execution is part of batch processing then this method returns the context of the outer batch request.Gets the HTTP method of the request.getParameter(String name) Gets a named parameter value.Gets information about the request path.getRequestHeader(String name) Returns the first found header value of the HTTP request.Returns all header values of the HTTP request but never null.Gets the list of all runtime measurements.Gets the OData service.booleanbooleanGets information about enabled debug mode.voidremoveParameter(String name) Removes parameter.voidsetAcceptableLanguages(List<Locale> acceptableLanguages) voidvoidsetDebugMode(boolean debugMode) Enables debug mode.voidsetHttpMethod(String httpMethod) voidsetParameter(String name, Object value) Sets a parameter.voidsetPathInfo(PathInfo uriInfo) voidsetRequest(ODataRequest request) voidsetService(ODataService service) voidsetServiceFactory(ODataServiceFactory serviceFactory) intstartRuntimeMeasurement(String className, String methodName) Starts runtime measurement.voidstopRuntimeMeasurement(int handle) Stops runtime measurement.
-
Constructor Details
-
ODataContextImpl
-
-
Method Details
-
setParameter
Description copied from interface:ODataContextSets a parameter.- Specified by:
setParameterin interfaceODataContext- Parameters:
name- of parameter (name is used as key, existing values are overwritten)value- of parameter as object
-
removeParameter
Description copied from interface:ODataContextRemoves parameter.- Specified by:
removeParameterin interfaceODataContext- Parameters:
name- of parameter to be removed
-
getParameter
Description copied from interface:ODataContextGets a named parameter value.- Specified by:
getParameterin interfaceODataContext- Parameters:
name- of parameter- Returns:
- parameter value as
Objectfor the given name
-
isInDebugMode
public boolean isInDebugMode()Description copied from interface:ODataContextGets information about enabled debug mode.- Specified by:
isInDebugModein interfaceODataContext- Returns:
- debugMode as boolean
-
setDebugMode
public void setDebugMode(boolean debugMode) Description copied from interface:ODataContextEnables debug mode.- Specified by:
setDebugModein interfaceODataContext- Parameters:
debugMode- as boolean
-
setService
-
getService
Description copied from interface:ODataContextGets the OData service.- Specified by:
getServicein interfaceODataContext- Returns:
- ODataService related for this context
- Throws:
ODataException
-
setPathInfo
-
getPathInfo
Description copied from interface:ODataContextGets information about the request path.- Specified by:
getPathInfoin interfaceODataContext- Returns:
- an OData path info object
- Throws:
ODataException
-
setServiceFactory
-
getServiceFactory
- Specified by:
getServiceFactoryin interfaceODataContext- Returns:
- the service factory instance
-
startRuntimeMeasurement
Description copied from interface:ODataContextStarts runtime measurement.- Specified by:
startRuntimeMeasurementin interfaceODataContext- Parameters:
className- class name where the runtime measurement startsmethodName- method name where the runtime measurement starts- Returns:
- handle for the started runtime measurement which can be used for stopping
-
stopRuntimeMeasurement
public void stopRuntimeMeasurement(int handle) Description copied from interface:ODataContextStops runtime measurement.- Specified by:
stopRuntimeMeasurementin interfaceODataContext- Parameters:
handle- of runtime measurement to be stopped
-
getRuntimeMeasurements
Description copied from interface:ODataContextGets the list of all runtime measurements.- Specified by:
getRuntimeMeasurementsin interfaceODataContext- Returns:
- list of all runtime measurements of type
ODataContext.RuntimeMeasurement
-
getRequestHeader
Description copied from interface:ODataContextReturns the first found header value of the HTTP request.- Specified by:
getRequestHeaderin interfaceODataContext- Parameters:
name- name of the first found request header element (e.g. "Content-Type")- Returns:
- null or a request header value if found
-
getRequestHeaders
Description copied from interface:ODataContextReturns all header values of the HTTP request but never null.- Specified by:
getRequestHeadersin interfaceODataContext- Returns:
- immutable map of request header values
-
getAcceptableLanguages
Description copied from interface:ODataContextGets a list of languages that are acceptable for the response. If no acceptable languages are specified, a read-only list containing a single wildcard java.util.Locale instance (with language field set to "*") is returned.- Specified by:
getAcceptableLanguagesin interfaceODataContext- Returns:
- a read-only list of acceptable languages sorted according to their q-value, with highest preference first.
-
setAcceptableLanguages
-
setHttpMethod
-
getHttpMethod
Description copied from interface:ODataContextGets the HTTP method of the request.- Specified by:
getHttpMethodin interfaceODataContext- Returns:
- HTTP method as
String
-
setRequest
-
setBatchParentContext
-
getBatchParentContext
Description copied from interface:ODataContextIf a request execution is part of batch processing then this method returns the context of the outer batch request.- Specified by:
getBatchParentContextin interfaceODataContext- Returns:
- a batch parent context or null
-
isInBatchMode
public boolean isInBatchMode()- Specified by:
isInBatchModein interfaceODataContext- Returns:
- true in case of this request is part of a batch processing queue
-