Package ca.uhn.fhir.jaxrs.server
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 Summary
ModifierConstructorDescriptionprotected
Default is DSTU2.protected
AbstractJaxRsProvider
(ca.uhn.fhir.context.FhirContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionca.uhn.fhir.context.api.AddProfileTagEnum
DEFAULT = AddProfileTagEnum.NEVERThis method returns the server base, including the resource path.This method returns the server base, independent of the request or resource.ca.uhn.fhir.rest.api.EncodingEnum
DEFAULT = EncodingEnum.JSONca.uhn.fhir.rest.server.ElementsSupportEnum
DEFAULT =ElementsSupportEnum.STANDARD
ca.uhn.fhir.rest.server.ETagSupportEnum
DEFAULT = ETagSupportEnum.DISABLEDca.uhn.fhir.context.FhirContext
jakarta.ws.rs.core.HttpHeaders
Get the headersList
<ca.uhn.fhir.rest.server.interceptor.IServerInterceptor> Default: an empty list of interceptors (Interceptors are not yet supported in the JAX-RS server).ca.uhn.fhir.interceptor.api.IInterceptorService
ca.uhn.fhir.rest.server.IPagingProvider
By default, no paging provider is usedThis method returns the query parametersgetRequest
(ca.uhn.fhir.rest.api.RequestTypeEnum requestType, ca.uhn.fhir.rest.api.RestOperationTypeEnum restOperation) Return the requestbuilder for the servergetRequest
(ca.uhn.fhir.rest.api.RequestTypeEnum requestType, ca.uhn.fhir.rest.api.RestOperationTypeEnum restOperation, String theResourceName) Return the requestbuilder for the serverca.uhn.fhir.rest.server.IServerAddressStrategy
This method returns the default server address strategy.jakarta.ws.rs.core.UriInfo
Get the uriInfojakarta.ws.rs.core.Response
handleException
(JaxRsRequest theRequest, Throwable theException) Convert an exception to a responseboolean
DEFAULT = truevoid
setHeaders
(jakarta.ws.rs.core.HttpHeaders headers) Set the headersvoid
setUriInfo
(jakarta.ws.rs.core.UriInfo uriInfo) Set the Uri Infoboolean
DEFAULT = falseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
getDefaultPageSize, getMaximumPageSize
-
Constructor Details
-
AbstractJaxRsProvider
protected AbstractJaxRsProvider()Default is DSTU2. UseAbstractJaxRsProvider(FhirContext)
to specify a DSTU3 context. -
AbstractJaxRsProvider
- Parameters:
ctx
- theFhirContext
to support.
-
-
Method Details
-
getInterceptorService
- Specified by:
getInterceptorService
in interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
getAddProfileTag
DEFAULT = AddProfileTagEnum.NEVER- Specified by:
getAddProfileTag
in interfaceca.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:
-
getDefaultResponseEncoding
DEFAULT = EncodingEnum.JSON- Specified by:
getDefaultResponseEncoding
in interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
getETagSupport
DEFAULT = ETagSupportEnum.DISABLED- Specified by:
getETagSupport
in interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
getElementsSupport
DEFAULT =ElementsSupportEnum.STANDARD
- Specified by:
getElementsSupport
in interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
getFhirContext
- Specified by:
getFhirContext
in interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
getHeaders
Get the headers- Returns:
- the headers
-
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 interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
- See Also:
-
getPagingProvider
By default, no paging provider is used- Specified by:
getPagingProvider
in interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
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 requestrestOperation
- 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 requestrestOperation
- the rest operation typetheResourceName
- the resource name- Returns:
- the requestbuilder
-
getServerAddressStrategy
This method returns the default server address strategy. The default strategy return the base uri for the requestgetBaseForRequest()
- Returns:
-
getUriInfo
Get the uriInfo- Returns:
- the uri info
-
handleException
public jakarta.ws.rs.core.Response handleException(JaxRsRequest theRequest, Throwable theException) throws IOException Convert an exception to a response- Parameters:
theRequest
- the incoming requesttheException
- the exception to convert- Returns:
- response
- Throws:
IOException
-
isDefaultPrettyPrint
DEFAULT = true- Specified by:
isDefaultPrettyPrint
in interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
setHeaders
Set the headers- Parameters:
headers
- the headers to set
-
setUriInfo
Set the Uri Info- Parameters:
uriInfo
- the uri info
-
withStackTrace
DEFAULT = false
-