Interface ODataContext
-
public interface ODataContextCompilation of generic context objects. @org.apache.olingo.odata2.DoNotImplement
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceODataContext.RuntimeMeasurementRuntime measurements.
-
Field Summary
Fields Modifier and Type Field Description static StringHTTP_SERVLET_REQUEST_OBJECT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Locale>getAcceptableLanguages()Gets a list of languages that are acceptable for the response.ODataContextgetBatchParentContext()If a request execution is part of batch processing then this method returns the context of the outer batch request.StringgetHttpMethod()Gets the HTTP method of the request.ObjectgetParameter(String name)Gets a named parameter value.PathInfogetPathInfo()Gets information about the request path.StringgetRequestHeader(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.ODataServicegetService()Gets the OData service.ODataServiceFactorygetServiceFactory()booleanisInBatchMode()booleanisInDebugMode()Gets 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 Detail
-
HTTP_SERVLET_REQUEST_OBJECT
static final String HTTP_SERVLET_REQUEST_OBJECT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getService
ODataService getService() throws ODataException
Gets the OData service.- Returns:
- ODataService related for this context
- Throws:
ODataException- Caso ocorra exceção OData
-
getServiceFactory
ODataServiceFactory getServiceFactory()
- Returns:
- the service factory instance
-
getPathInfo
PathInfo getPathInfo() throws ODataException
Gets information about the request path.- Returns:
- an OData path info object
- Throws:
ODataException- Caso ocorra exceção OData
-
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
int startRuntimeMeasurement(String className, String methodName)
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
void setParameter(String name, Object value)
Sets a parameter.- Parameters:
name- of parameter (name is used as key, existing values are overwritten)value- of parameter as object
-
removeParameter
void removeParameter(String name)
Removes parameter.- Parameters:
name- of parameter to be removed
-
getParameter
Object getParameter(String name)
Gets a named parameter value.- Parameters:
name- of parameter- Returns:
- parameter value as
Objectfor the given name
-
getRequestHeader
String getRequestHeader(String name)
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
Map<String,List<String>> 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
List<Locale> 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.
-
-