Class ODataContextImpl

java.lang.Object
org.apache.olingo.odata2.core.ODataContextImpl
All Implemented Interfaces:
ODataContext

public class ODataContextImpl extends Object implements ODataContext
Context.
  • Constructor Details

  • Method Details

    • setParameter

      public void setParameter(String name, Object value)
      Description copied from interface: ODataContext
      Sets a parameter.
      Specified by:
      setParameter in interface ODataContext
      Parameters:
      name - of parameter (name is used as key, existing values are overwritten)
      value - of parameter as object
    • removeParameter

      public void removeParameter(String name)
      Description copied from interface: ODataContext
      Removes parameter.
      Specified by:
      removeParameter in interface ODataContext
      Parameters:
      name - of parameter to be removed
    • getParameter

      public Object getParameter(String name)
      Description copied from interface: ODataContext
      Gets a named parameter value.
      Specified by:
      getParameter in interface ODataContext
      Parameters:
      name - of parameter
      Returns:
      parameter value as Object for the given name
    • isInDebugMode

      public boolean isInDebugMode()
      Description copied from interface: ODataContext
      Gets information about enabled debug mode.
      Specified by:
      isInDebugMode in interface ODataContext
      Returns:
      debugMode as boolean
    • setDebugMode

      public void setDebugMode(boolean debugMode)
      Description copied from interface: ODataContext
      Enables debug mode.
      Specified by:
      setDebugMode in interface ODataContext
      Parameters:
      debugMode - as boolean
    • setService

      public void setService(ODataService service)
    • getService

      public ODataService getService() throws ODataException
      Description copied from interface: ODataContext
      Gets the OData service.
      Specified by:
      getService in interface ODataContext
      Returns:
      ODataService related for this context
      Throws:
      ODataException
    • setPathInfo

      public void setPathInfo(PathInfo uriInfo)
    • getPathInfo

      public PathInfo getPathInfo() throws ODataException
      Description copied from interface: ODataContext
      Gets information about the request path.
      Specified by:
      getPathInfo in interface ODataContext
      Returns:
      an OData path info object
      Throws:
      ODataException
    • setServiceFactory

      public void setServiceFactory(ODataServiceFactory serviceFactory)
    • getServiceFactory

      public ODataServiceFactory getServiceFactory()
      Specified by:
      getServiceFactory in interface ODataContext
      Returns:
      the service factory instance
    • startRuntimeMeasurement

      public int startRuntimeMeasurement(String className, String methodName)
      Description copied from interface: ODataContext
      Starts runtime measurement.
      Specified by:
      startRuntimeMeasurement in interface ODataContext
      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

      public void stopRuntimeMeasurement(int handle)
      Description copied from interface: ODataContext
      Stops runtime measurement.
      Specified by:
      stopRuntimeMeasurement in interface ODataContext
      Parameters:
      handle - of runtime measurement to be stopped
    • getRuntimeMeasurements

      public List<ODataContext.RuntimeMeasurement> getRuntimeMeasurements()
      Description copied from interface: ODataContext
      Gets the list of all runtime measurements.
      Specified by:
      getRuntimeMeasurements in interface ODataContext
      Returns:
      list of all runtime measurements of type ODataContext.RuntimeMeasurement
    • getRequestHeader

      public String getRequestHeader(String name)
      Description copied from interface: ODataContext
      Returns the first found header value of the HTTP request.
      Specified by:
      getRequestHeader in interface ODataContext
      Parameters:
      name - name of the first found request header element (e.g. "Content-Type")
      Returns:
      null or a request header value if found
    • getRequestHeaders

      public Map<String,List<String>> getRequestHeaders()
      Description copied from interface: ODataContext
      Returns all header values of the HTTP request but never null.
      Specified by:
      getRequestHeaders in interface ODataContext
      Returns:
      immutable map of request header values
    • getAcceptableLanguages

      public List<Locale> getAcceptableLanguages()
      Description copied from interface: ODataContext
      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.
      Specified by:
      getAcceptableLanguages in interface ODataContext
      Returns:
      a read-only list of acceptable languages sorted according to their q-value, with highest preference first.
    • setAcceptableLanguages

      public void setAcceptableLanguages(List<Locale> acceptableLanguages)
    • setHttpMethod

      public void setHttpMethod(String httpMethod)
    • getHttpMethod

      public String getHttpMethod()
      Description copied from interface: ODataContext
      Gets the HTTP method of the request.
      Specified by:
      getHttpMethod in interface ODataContext
      Returns:
      HTTP method as String
    • setRequest

      public void setRequest(ODataRequest request)
    • setBatchParentContext

      public void setBatchParentContext(ODataContext ctx)
    • getBatchParentContext

      public ODataContext getBatchParentContext()
      Description copied from interface: ODataContext
      If a request execution is part of batch processing then this method returns the context of the outer batch request.
      Specified by:
      getBatchParentContext in interface ODataContext
      Returns:
      a batch parent context or null
    • isInBatchMode

      public boolean isInBatchMode()
      Specified by:
      isInBatchMode in interface ODataContext
      Returns:
      true in case of this request is part of a batch processing queue