Interface ODataContext


  • public interface ODataContext
    Compilation of generic context objects. @org.apache.olingo.odata2.DoNotImplement
    • Method Detail

      • 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 starts
        methodName - 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
      • 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 Object for 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.