public class ODataContextImpl extends Object implements ODataContext
| Modifier and Type | Class and Description |
|---|---|
protected class |
ODataContextImpl.RuntimeMeasurementImpl |
ODataContext.RuntimeMeasurementHTTP_SERVLET_REQUEST_OBJECT| Constructor and Description |
|---|
ODataContextImpl(ODataRequest request,
ODataServiceFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
List<Locale> |
getAcceptableLanguages()
Gets a list of languages that are acceptable for the response.
|
ODataContext |
getBatchParentContext()
If a request execution is part of batch processing then this method returns the context of the
outer batch request.
|
String |
getHttpMethod()
Gets the HTTP method of the request.
|
Object |
getParameter(String name)
Gets a named parameter value.
|
PathInfo |
getPathInfo()
Gets information about the request path.
|
String |
getRequestHeader(String name)
Returns the first found header value of the HTTP request.
|
Map<String,List<String>> |
getRequestHeaders()
Returns all header values of the HTTP request but never null.
|
List<ODataContext.RuntimeMeasurement> |
getRuntimeMeasurements()
Gets the list of all runtime measurements.
|
ODataService |
getService()
Gets the OData service.
|
ODataServiceFactory |
getServiceFactory() |
boolean |
isInBatchMode() |
boolean |
isInDebugMode()
Gets information about enabled debug mode.
|
void |
removeParameter(String name)
Removes parameter.
|
void |
setAcceptableLanguages(List<Locale> acceptableLanguages) |
void |
setBatchParentContext(ODataContext ctx) |
void |
setDebugMode(boolean debugMode)
Enables debug mode.
|
void |
setHttpMethod(String httpMethod) |
void |
setParameter(String name,
Object value)
Sets a parameter.
|
void |
setPathInfo(PathInfo uriInfo) |
void |
setRequest(ODataRequest request) |
void |
setService(ODataService service) |
void |
setServiceFactory(ODataServiceFactory serviceFactory) |
int |
startRuntimeMeasurement(String className,
String methodName)
Starts runtime measurement.
|
void |
stopRuntimeMeasurement(int handle)
Stops runtime measurement.
|
public ODataContextImpl(ODataRequest request, ODataServiceFactory factory)
public void setParameter(String name, Object value)
ODataContextsetParameter in interface ODataContextname - of parameter (name is used as key, existing values are overwritten)value - of parameter as objectpublic void removeParameter(String name)
ODataContextremoveParameter in interface ODataContextname - of parameter to be removedpublic Object getParameter(String name)
ODataContextgetParameter in interface ODataContextname - of parameterObject for the given namepublic boolean isInDebugMode()
ODataContextisInDebugMode in interface ODataContextpublic void setDebugMode(boolean debugMode)
ODataContextsetDebugMode in interface ODataContextdebugMode - as booleanpublic void setService(ODataService service)
public ODataService getService() throws ODataException
ODataContextgetService in interface ODataContextODataExceptionpublic void setPathInfo(PathInfo uriInfo)
public PathInfo getPathInfo() throws ODataException
ODataContextgetPathInfo in interface ODataContextODataExceptionpublic void setServiceFactory(ODataServiceFactory serviceFactory)
public ODataServiceFactory getServiceFactory()
getServiceFactory in interface ODataContextpublic int startRuntimeMeasurement(String className, String methodName)
ODataContextstartRuntimeMeasurement in interface ODataContextclassName - class name where the runtime measurement startsmethodName - method name where the runtime measurement startspublic void stopRuntimeMeasurement(int handle)
ODataContextstopRuntimeMeasurement in interface ODataContexthandle - of runtime measurement to be stoppedpublic List<ODataContext.RuntimeMeasurement> getRuntimeMeasurements()
ODataContextgetRuntimeMeasurements in interface ODataContextODataContext.RuntimeMeasurementpublic String getRequestHeader(String name)
ODataContextgetRequestHeader in interface ODataContextname - name of the first found request header element (e.g. "Content-Type")public Map<String,List<String>> getRequestHeaders()
ODataContextgetRequestHeaders in interface ODataContextpublic List<Locale> getAcceptableLanguages()
ODataContextgetAcceptableLanguages in interface ODataContextpublic void setHttpMethod(String httpMethod)
public String getHttpMethod()
ODataContextgetHttpMethod in interface ODataContextStringpublic void setRequest(ODataRequest request)
public void setBatchParentContext(ODataContext ctx)
public ODataContext getBatchParentContext()
ODataContextgetBatchParentContext in interface ODataContextpublic boolean isInBatchMode()
isInBatchMode in interface ODataContextCopyright © 2020. All rights reserved.