Class AbstractJaxRsProvider

java.lang.Object
ca.uhn.fhir.jaxrs.server.AbstractJaxRsProvider
All Implemented Interfaces:
ca.uhn.fhir.rest.server.IRestfulServerDefaults
Direct Known Subclasses:
AbstractJaxRsBundleProvider, AbstractJaxRsConformanceProvider, AbstractJaxRsPageProvider, AbstractJaxRsResourceProvider

public abstract class AbstractJaxRsProvider extends Object implements ca.uhn.fhir.rest.server.IRestfulServerDefaults
This is the abstract superclass for all jaxrs providers. It contains some defaults implementing the IRestfulServerDefaults interface and exposes the uri and headers.
Author:
Peter Van Houte | peter.vanhoute@agfa.com | Agfa Healthcare
  • Constructor Details

  • Method Details

    • getInterceptorService

      public ca.uhn.fhir.interceptor.api.IInterceptorService getInterceptorService()
      Specified by:
      getInterceptorService in interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
    • getAddProfileTag

      public ca.uhn.fhir.context.api.AddProfileTagEnum getAddProfileTag()
      DEFAULT = AddProfileTagEnum.NEVER
      Specified by:
      getAddProfileTag in interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
    • getBaseForRequest

      This method returns the server base, including the resource path. UriInfo#getBaseUri()
      Returns:
      the ascii string for the base resource provider path
    • getBaseForServer

      This method returns the server base, independent of the request or resource.
      Returns:
      the ascii string for the server base
      See Also:
      UriInfo.getBaseUri()
    • getDefaultResponseEncoding

      public ca.uhn.fhir.rest.api.EncodingEnum getDefaultResponseEncoding()
      DEFAULT = EncodingEnum.JSON
      Specified by:
      getDefaultResponseEncoding in interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
    • getETagSupport

      public ca.uhn.fhir.rest.server.ETagSupportEnum getETagSupport()
      DEFAULT = ETagSupportEnum.DISABLED
      Specified by:
      getETagSupport in interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
    • getElementsSupport

      public ca.uhn.fhir.rest.server.ElementsSupportEnum getElementsSupport()
      DEFAULT = ElementsSupportEnum.STANDARD
      Specified by:
      getElementsSupport in interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
    • getFhirContext

      public ca.uhn.fhir.context.FhirContext getFhirContext()
      Specified by:
      getFhirContext in interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
    • getHeaders

      public javax.ws.rs.core.HttpHeaders getHeaders()
      Get the headers
      Returns:
      the headers
    • getInterceptors_

      public List<ca.uhn.fhir.rest.server.interceptor.IServerInterceptor> getInterceptors_()
      Default: an empty list of interceptors (Interceptors are not yet supported in the JAX-RS server). Please get in touch if you'd like to help!
      Specified by:
      getInterceptors_ in interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
      See Also:
      IRestfulServerDefaults.getInterceptors_()
    • getPagingProvider

      public ca.uhn.fhir.rest.server.IPagingProvider getPagingProvider()
      By default, no paging provider is used
      Specified by:
      getPagingProvider in interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
    • getParameters

      public Map<String,​String[]> getParameters()
      This method returns the query parameters
      Returns:
      the query parameters
    • getRequest

      public JaxRsRequest.Builder getRequest(ca.uhn.fhir.rest.api.RequestTypeEnum requestType, ca.uhn.fhir.rest.api.RestOperationTypeEnum restOperation)
      Return the requestbuilder for the server
      Parameters:
      requestType - the type of the request
      restOperation - the rest operation type
      Returns:
      the requestbuilder
    • getRequest

      public JaxRsRequest.Builder getRequest(ca.uhn.fhir.rest.api.RequestTypeEnum requestType, ca.uhn.fhir.rest.api.RestOperationTypeEnum restOperation, String theResourceName)
      Return the requestbuilder for the server
      Parameters:
      requestType - the type of the request
      restOperation - the rest operation type
      theResourceName - the resource name
      Returns:
      the requestbuilder
    • getServerAddressStrategy

      public ca.uhn.fhir.rest.server.IServerAddressStrategy getServerAddressStrategy()
      This method returns the default server address strategy. The default strategy return the base uri for the request getBaseForRequest()
      Returns:
    • getUriInfo

      public javax.ws.rs.core.UriInfo getUriInfo()
      Get the uriInfo
      Returns:
      the uri info
    • handleException

      public javax.ws.rs.core.Response handleException(JaxRsRequest theRequest, Throwable theException) throws IOException
      Convert an exception to a response
      Parameters:
      theRequest - the incoming request
      theException - the exception to convert
      Returns:
      response
      Throws:
      IOException
    • isDefaultPrettyPrint

      public boolean isDefaultPrettyPrint()
      DEFAULT = true
      Specified by:
      isDefaultPrettyPrint in interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
    • setHeaders

      public void setHeaders(javax.ws.rs.core.HttpHeaders headers)
      Set the headers
      Parameters:
      headers - the headers to set
    • setUriInfo

      public void setUriInfo(javax.ws.rs.core.UriInfo uriInfo)
      Set the Uri Info
      Parameters:
      uriInfo - the uri info
    • withStackTrace

      public boolean withStackTrace()
      DEFAULT = false