
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
ConstructorsModifierConstructorDescriptionprotectedDefault is DSTU2.protectedAbstractJaxRsProvider(ca.uhn.fhir.context.FhirContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionca.uhn.fhir.context.api.AddProfileTagEnumDEFAULT = 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.EncodingEnumDEFAULT = EncodingEnum.JSONca.uhn.fhir.rest.server.ElementsSupportEnumDEFAULT =ElementsSupportEnum.STANDARDca.uhn.fhir.rest.server.ETagSupportEnumDEFAULT = ETagSupportEnum.DISABLEDca.uhn.fhir.context.FhirContextjakarta.ws.rs.core.HttpHeadersGet 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.IInterceptorServiceca.uhn.fhir.rest.server.IPagingProviderBy 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.IServerAddressStrategyThis method returns the default server address strategy.jakarta.ws.rs.core.UriInfoGet the uriInfojakarta.ws.rs.core.ResponsehandleException(JaxRsRequest theRequest, Throwable theException) Convert an exception to a responsebooleanDEFAULT = truevoidsetHeaders(jakarta.ws.rs.core.HttpHeaders headers) Set the headersvoidsetUriInfo(jakarta.ws.rs.core.UriInfo uriInfo) Set the Uri InfobooleanDEFAULT = falseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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- theFhirContextto support.
-
-
Method Details
-
getInterceptorService
- Specified by:
getInterceptorServicein interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
getAddProfileTag
DEFAULT = AddProfileTagEnum.NEVER- Specified by:
getAddProfileTagin 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:
getDefaultResponseEncodingin interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
getETagSupport
DEFAULT = ETagSupportEnum.DISABLED- Specified by:
getETagSupportin interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
getElementsSupport
DEFAULT =ElementsSupportEnum.STANDARD- Specified by:
getElementsSupportin interfaceca.uhn.fhir.rest.server.IRestfulServerDefaults
-
getFhirContext
- Specified by:
getFhirContextin 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:
getPagingProviderin 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:
isDefaultPrettyPrintin 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
-