Class JaxRsRequest

java.lang.Object
ca.uhn.fhir.rest.api.server.RequestDetails
ca.uhn.fhir.jaxrs.server.util.JaxRsRequest
All Implemented Interfaces:
ca.uhn.fhir.rest.api.server.IHasServletAttributes

public class JaxRsRequest extends ca.uhn.fhir.rest.api.server.RequestDetails implements ca.uhn.fhir.rest.api.server.IHasServletAttributes
The JaxRsRequest is a jax-rs specific implementation of the RequestDetails.
Author:
Peter Van Houte | peter.vanhoute@agfa.com | Agfa Healthcare
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An implementation of the builder pattern for the JaxRsRequest
  • Field Summary

    Fields inherited from class ca.uhn.fhir.rest.api.server.RequestDetails

    BAD_STREAM_PLACEHOLDER
  • Constructor Summary

    Constructors
    Constructor
    Description
    JaxRsRequest(AbstractJaxRsProvider server, String resourceString, ca.uhn.fhir.rest.api.RequestTypeEnum requestType, ca.uhn.fhir.rest.api.RestOperationTypeEnum restOperation)
    Utility Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addHeader(String theName, String theValue)
     
    getAttribute(String theAttributeName)
    Deprecated.
    Use RequestDetails.getUserData().
    protected byte[]
     
     
    ca.uhn.fhir.context.FhirContext
     
    getHeader(String headerKey)
     
     
     
     
    ca.uhn.fhir.rest.api.server.IRestfulResponse
     
     
     
    getServletAttribute(String theAttributeName)
    Gets an attribute from the servlet request.
    void
    setAttribute(String theAttributeName, Object theAttributeValue)
    Deprecated.
    Use RequestDetails.getUserData().
    void
    setHeaders(String theName, List<String> theValue)
     
    void
    Set the server
    void
    setServletAttribute(String theAttributeName, Object theAttributeValue)
    Sets an attribute on the servlet request.

    Methods inherited from class ca.uhn.fhir.rest.api.server.RequestDetails

    addParameter, getCompartmentName, getCompleteUrl, getConditionalUrl, getFhirServerBase, getFixedConditionalUrl, getId, getInterceptorBroadcaster, getMaxRetries, getOperation, getParameters, getRequestContentsIfLoaded, getRequestId, getRequestPath, getRequestStopwatch, getRequestType, getResource, getResourceName, getRestOperationType, getSecondaryOperation, getTenantId, getTransactionGuid, getUnqualifiedToQualifiedNames, getUserData, isPreferAsync, isRespondGzip, isRetry, isRewriteHistory, isSubRequest, loadRequestContents, removeParameter, setCompartmentName, setCompleteUrl, setFhirServerBase, setFixedConditionalUrl, setId, setMaxRetries, setOperation, setParameters, setRequestContents, setRequestId, setRequestPath, setRequestType, setResource, setResourceName, setRespondGzip, setResponse, setRestOperationType, setRetry, setRewriteHistory, setSecondaryOperation, setSubRequest, setTenantId, setTransactionGuid

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JaxRsRequest

      public JaxRsRequest(AbstractJaxRsProvider server, String resourceString, ca.uhn.fhir.rest.api.RequestTypeEnum requestType, ca.uhn.fhir.rest.api.RestOperationTypeEnum restOperation)
      Utility Constructor
      Parameters:
      server - the server
      resourceString - the resource body
      requestType - the request type
      restOperation - the operation type
  • Method Details

    • getByteStreamRequestContents

      protected byte[] getByteStreamRequestContents()
      Specified by:
      getByteStreamRequestContents in class ca.uhn.fhir.rest.api.server.RequestDetails
    • getCharset

      public Charset getCharset()
      Specified by:
      getCharset in class ca.uhn.fhir.rest.api.server.RequestDetails
    • getFhirContext

      public ca.uhn.fhir.context.FhirContext getFhirContext()
      Specified by:
      getFhirContext in class ca.uhn.fhir.rest.api.server.RequestDetails
    • getHeader

      public String getHeader(String headerKey)
      Specified by:
      getHeader in class ca.uhn.fhir.rest.api.server.RequestDetails
    • getHeaders

      public List<String> getHeaders(String name)
      Specified by:
      getHeaders in class ca.uhn.fhir.rest.api.server.RequestDetails
    • addHeader

      public void addHeader(String theName, String theValue)
      Specified by:
      addHeader in class ca.uhn.fhir.rest.api.server.RequestDetails
    • setHeaders

      public void setHeaders(String theName, List<String> theValue)
      Specified by:
      setHeaders in class ca.uhn.fhir.rest.api.server.RequestDetails
    • getServletAttribute

      public Object getServletAttribute(String theAttributeName)
      Gets an attribute from the servlet request. Attributes are used for interacting with servlet request attributes to communicate between servlet filters. These methods should not be used to pass information between interceptor methods. Use RequestDetails.getUserData() instead to pass information between interceptor methods.
      Specified by:
      getServletAttribute in interface ca.uhn.fhir.rest.api.server.IHasServletAttributes
      Parameters:
      theAttributeName - The attribute name
      Returns:
      The attribute value, or null if the attribute is not set
    • setServletAttribute

      public void setServletAttribute(String theAttributeName, Object theAttributeValue)
      Sets an attribute on the servlet request. Attributes are used for interacting with servlet request attributes to communicate between servlet filters. These methods should not be used to pass information between interceptor methods. Use RequestDetails.getUserData() instead to pass information between interceptor methods.
      Specified by:
      setServletAttribute in interface ca.uhn.fhir.rest.api.server.IHasServletAttributes
      Parameters:
      theAttributeName - The attribute name
      theAttributeValue - The attribute value
    • getAttribute

      @Deprecated public Object getAttribute(String theAttributeName)
      Deprecated.
      Use RequestDetails.getUserData(). If servlet attributes are truly required, then use IHasServletAttributes.getServletAttribute(String).
      Overrides:
      getAttribute in class ca.uhn.fhir.rest.api.server.RequestDetails
    • setAttribute

      @Deprecated public void setAttribute(String theAttributeName, Object theAttributeValue)
      Deprecated.
      Use RequestDetails.getUserData(). If servlet attributes are truly required, then use IHasServletAttributes.setServletAttribute(String, Object).
      Overrides:
      setAttribute in class ca.uhn.fhir.rest.api.server.RequestDetails
    • getInputStream

      Specified by:
      getInputStream in class ca.uhn.fhir.rest.api.server.RequestDetails
    • getReader

      public Reader getReader()
      Specified by:
      getReader in class ca.uhn.fhir.rest.api.server.RequestDetails
    • getResponse

      public ca.uhn.fhir.rest.api.server.IRestfulResponse getResponse()
      Overrides:
      getResponse in class ca.uhn.fhir.rest.api.server.RequestDetails
    • getServer

      Specified by:
      getServer in class ca.uhn.fhir.rest.api.server.RequestDetails
    • setServer

      public void setServer(AbstractJaxRsProvider theServer)
      Set the server
      Parameters:
      theServer - the server to set
    • getServerBaseForRequest

      Specified by:
      getServerBaseForRequest in class ca.uhn.fhir.rest.api.server.RequestDetails