Interface ODataContext
- All Known Implementing Classes:
ODataContextImpl
public interface ODataContext
Compilation of generic context objects.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRuntime measurements. -
Field Summary
Fields -
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.voidsetDebugMode(boolean debugMode) Enables debug mode.voidsetParameter(String name, Object value) Sets a parameter.intstartRuntimeMeasurement(String className, String methodName) Starts runtime measurement.voidstopRuntimeMeasurement(int handle) Stops runtime measurement.
-
Field Details
-
HTTP_SERVLET_REQUEST_OBJECT
- See Also:
-
-
Method Details
-
getService
Gets the OData service.- Returns:
- ODataService related for this context
- Throws:
ODataException
-
getServiceFactory
ODataServiceFactory getServiceFactory()- Returns:
- the service factory instance
-
getPathInfo
Gets information about the request path.- Returns:
- an OData path info object
- Throws:
ODataException
-
getBatchParentContext
ODataContext getBatchParentContext()If a request execution is part of batch processing then this method returns the context of the outer batch request.- Returns:
- a batch parent context or null
-
isInBatchMode
boolean isInBatchMode()- Returns:
- true in case of this request is part of a batch processing queue
-
startRuntimeMeasurement
Starts runtime measurement.- 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
void stopRuntimeMeasurement(int handle) Stops runtime measurement.- Parameters:
handle- of runtime measurement to be stopped
-
getRuntimeMeasurements
List<ODataContext.RuntimeMeasurement> getRuntimeMeasurements()Gets the list of all runtime measurements.- Returns:
- list of all runtime measurements of type
ODataContext.RuntimeMeasurement
-
getHttpMethod
String getHttpMethod()Gets the HTTP method of the request.- Returns:
- HTTP method as
String
-
setParameter
Sets a parameter.- Parameters:
name- of parameter (name is used as key, existing values are overwritten)value- of parameter as object
-
removeParameter
Removes parameter.- Parameters:
name- of parameter to be removed
-
getParameter
Gets a named parameter value.- Parameters:
name- of parameter- Returns:
- parameter value as
Objectfor the given name
-
getRequestHeader
Returns the first found header value of the HTTP request.- Parameters:
name- name of the first found request header element (e.g. "Content-Type")- Returns:
- null or a request header value if found
-
getRequestHeaders
Returns all header values of the HTTP request but never null.- Returns:
- immutable map of request header values
-
isInDebugMode
boolean isInDebugMode()Gets information about enabled debug mode.- Returns:
- debugMode as boolean
-
setDebugMode
void setDebugMode(boolean debugMode) Enables debug mode.- Parameters:
debugMode- as boolean
-
getAcceptableLanguages
Gets 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.- Returns:
- a read-only list of acceptable languages sorted according to their q-value, with highest preference first.
-